aboutsummaryrefslogtreecommitdiff
path: root/src/services/api/api.service.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2018-12-04 09:56:45 +0300
committerHenry Jameson <me@hjkos.com>2018-12-04 09:56:45 +0300
commit7a13c530c76586a56309bfd2347374ece345ad08 (patch)
treee62868d2e10c49e00f7c65057323931c469afb1b /src/services/api/api.service.js
parent6b3489a4d30b6530091919b4c44617a3294ffdd2 (diff)
parent480f617c098c831e095a686abb319f4e467e15e4 (diff)
Merge remote-tracking branch 'upstream/develop' into search-mobile-fixes
* upstream/develop: addressed PR comments added tooltip Add userId property to timelines so that we don't overwrite user timeline meant for another user Added option to auto-hide subject field when it's empty. removes hacks from notifications storage, adds api call to let server update is_seen attribute fixes vimium not giving retweet button a hint
Diffstat (limited to 'src/services/api/api.service.js')
-rw-r--r--src/services/api/api.service.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 714c0fc7..ae876b7f 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -29,6 +29,7 @@ const PROFILE_UPDATE_URL = '/api/account/update_profile.json'
const EXTERNAL_PROFILE_URL = '/api/externalprofile/show.json'
const QVITTER_USER_TIMELINE_URL = '/api/qvitter/statuses/user_timeline.json'
const QVITTER_USER_NOTIFICATIONS_URL = '/api/qvitter/statuses/notifications.json'
+const QVITTER_USER_NOTIFICATIONS_READ_URL = '/api/qvitter/statuses/notifications/read.json'
const BLOCKING_URL = '/api/blocks/create.json'
const UNBLOCKING_URL = '/api/blocks/destroy.json'
const USER_URL = '/api/users/show.json'
@@ -460,6 +461,18 @@ const suggestions = ({credentials}) => {
}).then((data) => data.json())
}
+const markNotificationsAsSeen = ({id, credentials}) => {
+ const body = new FormData()
+
+ body.append('latest_id', id)
+
+ return fetch(QVITTER_USER_NOTIFICATIONS_READ_URL, {
+ body,
+ headers: authHeaders(credentials),
+ method: 'POST'
+ }).then((data) => data.json())
+}
+
const apiService = {
verifyCredentials,
fetchTimeline,
@@ -494,7 +507,8 @@ const apiService = {
fetchFollowRequests,
approveUser,
denyUser,
- suggestions
+ suggestions,
+ markNotificationsAsSeen
}
export default apiService