Profile editing: Utilize new API (#37990)
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
import { apiRequestPost, apiRequestGet, apiRequestDelete } from 'mastodon/api';
|
||||
import {
|
||||
apiRequestPost,
|
||||
apiRequestGet,
|
||||
apiRequestDelete,
|
||||
apiRequestPatch,
|
||||
} from 'mastodon/api';
|
||||
import type {
|
||||
ApiAccountJSON,
|
||||
ApiFamiliarFollowersJSON,
|
||||
@@ -9,6 +14,11 @@ import type {
|
||||
ApiHashtagJSON,
|
||||
} from 'mastodon/api_types/tags';
|
||||
|
||||
import type {
|
||||
ApiProfileJSON,
|
||||
ApiProfileUpdateParams,
|
||||
} from '../api_types/profile';
|
||||
|
||||
export const apiSubmitAccountNote = (id: string, value: string) =>
|
||||
apiRequestPost<ApiRelationshipJSON>(`v1/accounts/${id}/note`, {
|
||||
comment: value,
|
||||
@@ -54,3 +64,8 @@ export const apiGetFamiliarFollowers = (id: string) =>
|
||||
apiRequestGet<ApiFamiliarFollowersJSON>('v1/accounts/familiar_followers', {
|
||||
id,
|
||||
});
|
||||
|
||||
export const apiGetProfile = () => apiRequestGet<ApiProfileJSON>('v1/profile');
|
||||
|
||||
export const apiPatchProfile = (params: ApiProfileUpdateParams) =>
|
||||
apiRequestPatch<ApiProfileJSON>('v1/profile', params);
|
||||
|
||||
Reference in New Issue
Block a user