diff options
| author | taehoon <th.dev91@gmail.com> | 2019-03-21 21:53:24 -0400 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-03-21 21:53:24 -0400 |
| commit | a64e744c1b4aca4bd4ec2ba78a364dd2bbf81b47 (patch) | |
| tree | ae3b958c401ad91e82cc1ce6a5f67a301adcebeb /src/services/api/api.service.js | |
| parent | 8702d23a137d06607fc525b6c791abe24ed021ff (diff) | |
switch to mastoapi
Diffstat (limited to 'src/services/api/api.service.js')
| -rw-r--r-- | src/services/api/api.service.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 36441017..8586f993 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -18,8 +18,6 @@ const MENTIONS_URL = '/api/statuses/mentions.json' const DM_TIMELINE_URL = '/api/statuses/dm_timeline.json' const FOLLOWERS_URL = '/api/statuses/followers.json' const FRIENDS_URL = '/api/statuses/friends.json' -const MUTING_URL = '/api/v1/accounts/:id/mute' -const UNMUTING_URL = '/api/v1/accounts/:id/unmute' const FOLLOWING_URL = '/api/friendships/create.json' const UNFOLLOWING_URL = '/api/friendships/destroy.json' const REGISTRATION_URL = '/api/account/register.json' @@ -46,12 +44,13 @@ const MASTODON_USER_BLOCKS_URL = '/api/v1/blocks/' const MASTODON_USER_MUTES_URL = '/api/v1/mutes/' const MASTODON_BLOCK_USER_URL = id => `/api/v1/accounts/${id}/block` const MASTODON_UNBLOCK_USER_URL = id => `/api/v1/accounts/${id}/unblock` +const MASTODON_MUTE_USER_URL = id => `/api/v1/accounts/${id}/mute` +const MASTODON_UNMUTE_USER_URL = id => `/api/v1/accounts/${id}/unmute` import { each, map } from 'lodash' import { parseStatus, parseUser, parseNotification } from '../entity_normalizer/entity_normalizer.service.js' import 'whatwg-fetch' import { StatusCodeError } from '../errors/errors' -import { generateUrl } from '../../utils/url' const oldfetch = window.fetch @@ -533,16 +532,14 @@ const fetchMutes = ({credentials}) => { } const muteUser = ({id, credentials}) => { - const url = generateUrl(MUTING_URL, { id }) - return promisedRequest(url, { + return promisedRequest(MASTODON_MUTE_USER_URL(id), { headers: authHeaders(credentials), method: 'POST' }) } const unmuteUser = ({id, credentials}) => { - const url = generateUrl(UNMUTING_URL, { id }) - return promisedRequest(url, { + return promisedRequest(MASTODON_UNMUTE_USER_URL(id), { headers: authHeaders(credentials), method: 'POST' }) |
