mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-05 08:43:09 +02:00
chore: lint
This commit is contained in:
parent
81def9457b
commit
e24a57402b
1 changed files with 4 additions and 1 deletions
|
@ -292,7 +292,9 @@ export class MastodonApiServerService {
|
|||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if ((_request.body as any).fields_attributes) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const fields = (_request.body as any).fields_attributes.map((field: any) => {
|
||||
if (!(field.name.trim() === '' && field.value.trim() === '')) {
|
||||
if (field.name.trim() === '') return reply.code(400).send('Field name can not be empty');
|
||||
|
@ -302,9 +304,10 @@ export class MastodonApiServerService {
|
|||
...field,
|
||||
};
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(_request.body as any).fields_attributes = fields.filter((field: any) => field.name.trim().length > 0 && field.value.length > 0);
|
||||
}
|
||||
|
||||
|
||||
const data = await client.updateCredentials(_request.body!);
|
||||
reply.send(await this.mastoConverter.convertAccount(data.data));
|
||||
} catch (e: any) {
|
||||
|
|
Loading…
Reference in a new issue