add basic idempotency support

This commit is contained in:
Shpuld Shpuldson 2020-07-15 16:19:57 +03:00
parent 297a0c1f7f
commit 89a677f5e8
3 changed files with 52 additions and 28 deletions

View file

@ -11,7 +11,8 @@ const postStatus = ({
media = [],
inReplyToStatusId = undefined,
contentType = 'text/plain',
preview = false
preview = false,
idempotencyKey = ''
}) => {
const mediaIds = map(media, 'id')
@ -25,9 +26,14 @@ const postStatus = ({
inReplyToStatusId,
contentType,
poll,
preview
preview,
idempotencyKey
})
.then((data) => {
return {
error: 'test'
}
/*
if (!data.error && !preview) {
store.dispatch('addNewStatuses', {
statuses: [data],
@ -37,6 +43,7 @@ const postStatus = ({
})
}
return data
*/
})
.catch((err) => {
return {