mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
bf45e97641
* Update types * fix circular dep * type imports * lint type imports and --fix
21 lines
548 B
TypeScript
21 lines
548 B
TypeScript
import { computed } from "mobx";
|
|
import ApiKey from "~/models/ApiKey";
|
|
import type RootStore from "./RootStore";
|
|
import Store, { RPCAction } from "./base/Store";
|
|
|
|
export default class ApiKeysStore extends Store<ApiKey> {
|
|
actions = [RPCAction.List, RPCAction.Create, RPCAction.Delete];
|
|
|
|
constructor(rootStore: RootStore) {
|
|
super(rootStore, ApiKey);
|
|
}
|
|
|
|
@computed
|
|
get personalApiKeys() {
|
|
const userId = this.rootStore.auth.user?.id;
|
|
return userId
|
|
? this.orderedData.filter((key) => key.userId === userId)
|
|
: [];
|
|
}
|
|
}
|