diff options
| author | Shpuld Shpludson <shp@cock.li> | 2020-05-02 11:19:05 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2020-05-02 11:19:05 +0000 |
| commit | 5f90b6a384583a00769eeca3a6c6e2deec8bdd24 (patch) | |
| tree | fb6b7307cbb3785ae0b1da17fe7b1ac730e9965f /src/services/api/api.service.js | |
| parent | c67e9daf068c5a7eafaa7ce6a6418c8916a4f118 (diff) | |
| parent | 92ccaa97bb0a2c15b96e2fbcf03823ba902dc516 (diff) | |
Merge branch 'fix/follow-request-notification-bugfixes' into 'develop'
Fix remaining follow request notif problems
Closes #823
See merge request pleroma/pleroma-fe!1096
Diffstat (limited to 'src/services/api/api.service.js')
| -rw-r--r-- | src/services/api/api.service.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 3a58c38d..72c8874f 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -4,7 +4,6 @@ import 'whatwg-fetch' import { RegistrationError, StatusCodeError } from '../errors/errors' /* eslint-env browser */ -const QVITTER_USER_NOTIFICATIONS_READ_URL = '/api/qvitter/statuses/notifications/read.json' const BLOCKS_IMPORT_URL = '/api/pleroma/blocks_import' const FOLLOW_IMPORT_URL = '/api/pleroma/follow_import' const DELETE_ACCOUNT_URL = '/api/pleroma/delete_account' @@ -17,6 +16,7 @@ const DEACTIVATE_USER_URL = '/api/pleroma/admin/users/deactivate' const ADMIN_USERS_URL = '/api/pleroma/admin/users' const SUGGESTIONS_URL = '/api/v1/suggestions' const NOTIFICATION_SETTINGS_URL = '/api/pleroma/notification_settings' +const NOTIFICATION_READ_URL = '/api/v1/pleroma/notifications/read' const MFA_SETTINGS_URL = '/api/pleroma/accounts/mfa' const MFA_BACKUP_CODES_URL = '/api/pleroma/accounts/mfa/backup_codes' @@ -841,12 +841,16 @@ const suggestions = ({ credentials }) => { }).then((data) => data.json()) } -const markNotificationsAsSeen = ({ id, credentials }) => { +const markNotificationsAsSeen = ({ id, credentials, single = false }) => { const body = new FormData() - body.append('latest_id', id) + if (single) { + body.append('id', id) + } else { + body.append('max_id', id) + } - return fetch(QVITTER_USER_NOTIFICATIONS_READ_URL, { + return fetch(NOTIFICATION_READ_URL, { body, headers: authHeaders(credentials), method: 'POST' |
