This commit is contained in:
Kristaps Fabians Geikins 2024-09-17 14:41:13 +03:00
Родитель 1922c0563b
Коммит cfabada3cd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 16D20A16730A0111
2 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -3,7 +3,7 @@ import { ServerAppRecord, UserRecord } from '@/modules/core/helpers/types'
export type FullServerApp = ServerAppRecord & {
scopes: ScopeRecord[]
author: Pick<UserRecord, 'id' | 'name' | 'avatar'>
author: Pick<UserRecord, 'id' | 'name' | 'avatar'> | null
}
export type ServerAppListItem = Pick<

Просмотреть файл

@ -66,7 +66,7 @@ export const getAppFactory =
return {
...app,
scopes: appScopes,
author: appAuthor!,
author: appAuthor || null,
redirectUrl: getAppRedirectUrl(app)
}
}
@ -84,7 +84,8 @@ export const getAllPublicAppsFactory =
| 'redirectUrl'
| 'logo'
| 'termsAndConditionsLink'
> & { authorName: string; authorId: string }
> &
Partial<{ authorName: string; authorId: string }>
> = await tables
.serverApps(deps.db)
.select(
@ -105,7 +106,10 @@ export const getAllPublicAppsFactory =
return apps.map((app) => ({
...app,
redirectUrl: getAppRedirectUrl(app),
author: { name: app.authorName, id: app.authorId, avatar: null }
author:
app.authorId && app.authorName
? { name: app.authorName, id: app.authorId, avatar: null }
: null
}))
}