Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F325871
status_poster.service.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
status_poster.service.js
View Options
import
{
map
}
from
'lodash'
import
apiService
from
'../api/api.service.js'
const
postStatus
=
({
store
,
status
,
spoilerText
,
visibility
,
sensitive
,
poll
,
media
=
[],
inReplyToStatusId
=
undefined
,
contentType
=
'text/plain'
})
=>
{
const
mediaIds
=
map
(
media
,
'id'
)
return
apiService
.
postStatus
({
credentials
:
store
.
state
.
users
.
currentUser
.
credentials
,
status
,
spoilerText
,
visibility
,
sensitive
,
mediaIds
,
inReplyToStatusId
,
contentType
,
poll
})
.
then
((
data
)
=>
{
if
(
!
data
.
error
)
{
store
.
dispatch
(
'addNewStatuses'
,
{
statuses
:
[
data
],
timeline
:
'friends'
,
showImmediately
:
true
,
noIdUpdate
:
true
// To prevent missing notices on next pull.
})
}
return
data
})
.
catch
((
err
)
=>
{
return
{
error
:
err
.
message
}
})
}
const
uploadMedia
=
({
store
,
formData
})
=>
{
const
credentials
=
store
.
state
.
users
.
currentUser
.
credentials
return
apiService
.
uploadMedia
({
credentials
,
formData
})
}
const
statusPosterService
=
{
postStatus
,
uploadMedia
}
export
default
statusPosterService
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 24, 4:26 AM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
94589
Default Alt Text
status_poster.service.js (1 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment