mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat(api): ✨ Add Emoji Reactions
This commit is contained in:
parent
70974d3c35
commit
9722b94eae
17 changed files with 755 additions and 7 deletions
|
|
@ -27,7 +27,11 @@ import type {
|
|||
import type { Tag } from "../schemas/tag.ts";
|
||||
import type { Token } from "../schemas/token.ts";
|
||||
import type { TermsOfService } from "../schemas/tos.ts";
|
||||
import type { Challenge, Role } from "../schemas/versia.ts";
|
||||
import type {
|
||||
Challenge,
|
||||
NoteReactionWithAccounts,
|
||||
Role,
|
||||
} from "../schemas/versia.ts";
|
||||
import { BaseClient, type Output } from "./base.ts";
|
||||
import { DEFAULT_SCOPE, NO_REDIRECT } from "./constants.ts";
|
||||
|
||||
|
|
@ -217,7 +221,7 @@ export class Client extends BaseClient {
|
|||
emoji: string,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<z.infer<typeof Status>>> {
|
||||
return this.post<z.infer<typeof Status>>(
|
||||
return this.put<z.infer<typeof Status>>(
|
||||
`/api/v1/statuses/${id}/reactions/${emoji}`,
|
||||
undefined,
|
||||
extra,
|
||||
|
|
@ -2090,6 +2094,22 @@ export class Client extends BaseClient {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /api/v1/statuses/:id/reactions
|
||||
*
|
||||
* @param id The target status id.
|
||||
* @return Array of reactions with accounts.
|
||||
*/
|
||||
public getStatusReactions(
|
||||
id: string,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<z.infer<typeof NoteReactionWithAccounts>[]>> {
|
||||
return this.get<z.infer<typeof NoteReactionWithAccounts>[]>(
|
||||
`/api/v1/statuses/${id}/reactions`,
|
||||
extra,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /api/v1/featured_tags/suggestions
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue