diff --git a/app/models/ApiKey.ts b/app/models/ApiKey.ts index fb73d2cf43..1c62942906 100644 --- a/app/models/ApiKey.ts +++ b/app/models/ApiKey.ts @@ -2,6 +2,8 @@ import { isPast } from "date-fns"; import { computed, observable } from "mobx"; import ParanoidModel from "./base/ParanoidModel"; import Field from "./decorators/Field"; +import User from "./User"; +import Relation from "./decorators/Relation"; class ApiKey extends ParanoidModel { static modelName = "ApiKey"; @@ -25,6 +27,10 @@ class ApiKey extends ParanoidModel { @observable lastActiveAt?: string; + /** The user who this API key belongs to. */ + @Relation(() => User) + user: User; + /** The user ID that the API key belongs to. */ userId: string; diff --git a/app/scenes/Settings/components/ApiKeyListItem.tsx b/app/scenes/Settings/components/ApiKeyListItem.tsx index 622748f043..a275b8d1fe 100644 --- a/app/scenes/Settings/components/ApiKeyListItem.tsx +++ b/app/scenes/Settings/components/ApiKeyListItem.tsx @@ -32,7 +32,7 @@ const ApiKeyListItem = ({ apiKey }: Props) => { {t(`Created`)}