Add ability to list quotes of one's own posts (#35914)
This commit is contained in:
parent
9c55b2fbe4
commit
02de05dc27
8 changed files with 185 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { apiRequestPost } from 'mastodon/api';
|
||||
import api, { apiRequestPost, getLinks } from 'mastodon/api';
|
||||
import type { ApiStatusJSON } from 'mastodon/api_types/statuses';
|
||||
import type { StatusVisibility } from 'mastodon/models/status';
|
||||
|
||||
|
|
@ -14,3 +14,15 @@ export const apiRevokeQuote = (quotedStatusId: string, statusId: string) =>
|
|||
apiRequestPost<ApiStatusJSON>(
|
||||
`v1/statuses/${quotedStatusId}/quotes/${statusId}/revoke`,
|
||||
);
|
||||
|
||||
export const apiGetQuotes = async (statusId: string, url?: string) => {
|
||||
const response = await api().request<ApiStatusJSON[]>({
|
||||
method: 'GET',
|
||||
url: url ?? `/api/v1/statuses/${statusId}/quotes`,
|
||||
});
|
||||
|
||||
return {
|
||||
statuses: response.data,
|
||||
links: getLinks(response),
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue