Profile editing: Utilize new API (#37990)

This commit is contained in:
Echo
2026-02-26 13:55:10 +00:00
committed by GitHub
parent 51b81b3ce9
commit d18a47b6a7
11 changed files with 283 additions and 101 deletions
+16 -1
View File
@@ -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);