[Glitch] Profile editing: Featured tags

Port ef6405ab28 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Echo authored and Claire committed 2026-02-23 18:34:58 +01:00
1 parent 7309703de4
commit ff7c61b82c
16 files changed
+864 -114

No files matched your search

+22 -3
View File
@@ -1,10 +1,17 @@
import { apiRequestPost, apiRequestGet } from 'flavours/glitch/api';
import {
apiRequestPost,
apiRequestGet,
apiRequestDelete,
} from 'flavours/glitch/api';
import type {
ApiAccountJSON,
ApiFamiliarFollowersJSON,
} from 'flavours/glitch/api_types/accounts';
import type { ApiRelationshipJSON } from 'flavours/glitch/api_types/relationships';
import type { ApiHashtagJSON } from 'flavours/glitch/api_types/tags';
import type {
ApiFeaturedTagJSON,
ApiHashtagJSON,
} from 'flavours/glitch/api_types/tags';
export const apiSubmitAccountNote = (id: string, value: string) =>
apiRequestPost<ApiRelationshipJSON>(`v1/accounts/${id}/note`, {
@@ -30,7 +37,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`);