bugfix
This commit is contained in:
Родитель
1922c0563b
Коммит
cfabada3cd
|
@ -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
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче