style: fixed some deepscan warnings

This commit is contained in:
원더 2021-01-14 10:29:44 +09:00
parent 1a1eeb2b44
commit 8edaac1373
2 changed files with 15 additions and 9 deletions

View File

@ -183,11 +183,17 @@ const Bots: NextPage<BotsProps> = ({ data, date }) => {
<hr />
<table>
<th>foo</th>
<th>bar</th>
<thead>
<tr>
<th>foo</th>
<th>bar</th>
</tr>
</thead>
<tbody>
<td>pizza</td>
<td>apple</td>
<tr>
<td>pizza</td>
<td>apple</td>
</tr>
</tbody>
</table>
<ul className='list-disc'>

View File

@ -48,12 +48,12 @@ async function getBot(id: string, owners=true) {
res[0].category = JSON.parse(res[0].category)
res[0].owners = JSON.parse(res[0].owners)
res[0].vanity = ((res[0].trusted || res[0].partnered) && res[0].vanity) ?? null
if (owners)
res[0].owners = await Promise.all(
res[0].owners.map(async (u: string) => await get._rawUser.load(u))
)
res[0].owners = res[0].owners.filter((el: User | null) => el).map((row: User) => ({ ...row }))
}
if (owners)
res[0].owners = await Promise.all(
res[0].owners.map(async (u: string) => await get._rawUser.load(u))
)
res[0].owners = res[0].owners.filter((el: User | null) => el).map((row: User) => ({ ...row }))
return res[0] ?? null
}