feat(api): add apikey support (#408)

* feat(api): add apikey support

* feat(web): api settings crud
This commit is contained in:
ze0s 2022-08-15 11:58:13 +02:00 committed by GitHub
parent 9c036033e9
commit fa20978d58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 834 additions and 70 deletions

View file

@ -74,6 +74,11 @@ export const APIClient = {
delete: (id: number) => appClient.Delete(`api/actions/${id}`),
toggleEnable: (id: number) => appClient.Patch(`api/actions/${id}/toggleEnabled`)
},
apikeys: {
getAll: () => appClient.Get<APIKey[]>("api/keys"),
create: (key: APIKey) => appClient.Post("api/keys", key),
delete: (key: string) => appClient.Delete(`api/keys/${key}`),
},
config: {
get: () => appClient.Get<Config>("api/config")
},