change types
This commit is contained in:
parent
a480e1be55
commit
14f40f0051
1 changed files with 3 additions and 3 deletions
|
@ -301,12 +301,12 @@ export function apiAccountMastodon(router: Router): void {
|
||||||
const client = getClient(BASE_URL, accessTokens);
|
const client = getClient(BASE_URL, accessTokens);
|
||||||
let users;
|
let users;
|
||||||
try {
|
try {
|
||||||
const idsRaw = (ctx.query as any)["id[]"];
|
const idsRaw = ctx.query["id[]"];
|
||||||
const ids = typeof idsRaw === "string" ? [idsRaw] : idsRaw;
|
const ids = typeof idsRaw === "string" ? [idsRaw] : idsRaw;
|
||||||
users = ids;
|
users = ids;
|
||||||
relationshopModel.id = idsRaw || "1";
|
relationshopModel.id = idsRaw?.toString() || "1";
|
||||||
if (!idsRaw) return [relationshopModel];
|
if (!idsRaw) return [relationshopModel];
|
||||||
const data = (await client.getRelationships(ids)) as any;
|
const data = (await client.getRelationships(ids ? ids : [])) as any;
|
||||||
ctx.body = data.data;
|
ctx.body = data.data;
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
Loading…
Reference in a new issue