Profile editing: Featured tags (#37952)
This commit is contained in:
17 files changed
+869
-115
No files matched your search
@@ -1,10 +1,13 @@
|
||||
import { apiRequestPost, apiRequestGet } from 'mastodon/api';
|
||||
import { apiRequestPost, apiRequestGet, apiRequestDelete } from 'mastodon/api';
|
||||
import type {
|
||||
ApiAccountJSON,
|
||||
ApiFamiliarFollowersJSON,
|
||||
} from 'mastodon/api_types/accounts';
|
||||
import type { ApiRelationshipJSON } from 'mastodon/api_types/relationships';
|
||||
import type { ApiHashtagJSON } from 'mastodon/api_types/tags';
|
||||
import type {
|
||||
ApiFeaturedTagJSON,
|
||||
ApiHashtagJSON,
|
||||
} from 'mastodon/api_types/tags';
|
||||
|
||||
export const apiSubmitAccountNote = (id: string, value: string) =>
|
||||
apiRequestPost<ApiRelationshipJSON>(`v1/accounts/${id}/note`, {
|
||||
@@ -30,7 +33,19 @@ export const apiRemoveAccountFromFollowers = (id: string) =>
|
||||
);
|
||||
|
||||
export const apiGetFeaturedTags = (id: string) =>
|
||||
apiRequestGet<ApiHashtagJSON>(`v1/accounts/${id}/featured_tags`);
|
||||
apiRequestGet<ApiHashtagJSON[]>(`v1/accounts/${id}/featured_tags`);
|
||||
|
||||
export const apiGetCurrentFeaturedTags = () =>
|
||||
apiRequestGet<ApiFeaturedTagJSON[]>(`v1/featured_tags`);
|
||||
|
||||
export const apiPostFeaturedTag = (name: string) =>
|
||||
apiRequestPost<ApiFeaturedTagJSON>('v1/featured_tags', { name });
|
||||
|
||||
export const apiDeleteFeaturedTag = (id: string) =>
|
||||
apiRequestDelete(`v1/featured_tags/${id}`);
|
||||
|
||||
export const apiGetTagSuggestions = () =>
|
||||
apiRequestGet<ApiHashtagJSON[]>('v1/featured_tags/suggestions');
|
||||
|
||||
export const apiGetEndorsedAccounts = (id: string) =>
|
||||
apiRequestGet<ApiAccountJSON>(`v1/accounts/${id}/endorsements`);
|
||||
|
||||
Reference in new issue
Block a user