chore: lint

This commit is contained in:
Mar0xy 2023-10-30 01:47:24 +01:00
parent 81def9457b
commit e24a57402b
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828

View file

@ -292,7 +292,9 @@ export class MastodonApiServerService {
} }
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((_request.body as any).fields_attributes) { 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) => { const fields = (_request.body as any).fields_attributes.map((field: any) => {
if (!(field.name.trim() === '' && field.value.trim() === '')) { if (!(field.name.trim() === '' && field.value.trim() === '')) {
if (field.name.trim() === '') return reply.code(400).send('Field name can not be empty'); if (field.name.trim() === '') return reply.code(400).send('Field name can not be empty');
@ -302,9 +304,10 @@ export class MastodonApiServerService {
...field, ...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); (_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!); const data = await client.updateCredentials(_request.body!);
reply.send(await this.mastoConverter.convertAccount(data.data)); reply.send(await this.mastoConverter.convertAccount(data.data));
} catch (e: any) { } catch (e: any) {