mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-25 13:39:06 +01:00
[mastodon-client] Fix polls param
This commit is contained in:
parent
0f17691f00
commit
db95d9a7f3
@ -219,14 +219,14 @@ export function setupEndpointsStatus(router: Router): void {
|
||||
router.get<{ Params: { id: string } }>("/v1/polls/:id",
|
||||
auth(false, ["read:statuses"]),
|
||||
async (ctx) => {
|
||||
const note = await NoteHelpers.getNoteOr404(ctx.params.name, ctx);
|
||||
const note = await NoteHelpers.getNoteOr404(ctx.params.id, ctx);
|
||||
ctx.body = await PollHelpers.getPoll(note, ctx);
|
||||
});
|
||||
router.post<{ Params: { id: string } }>(
|
||||
"/v1/polls/:id/votes",
|
||||
auth(true, ["write:statuses"]),
|
||||
async (ctx) => {
|
||||
const note = await NoteHelpers.getNoteOr404(ctx.params.name, ctx);
|
||||
const note = await NoteHelpers.getNoteOr404(ctx.params.id, ctx);
|
||||
|
||||
const body: any = ctx.request.body;
|
||||
const choices = toArray(body.choices ?? []).map(p => parseInt(p));
|
||||
|
Loading…
Reference in New Issue
Block a user