feat: get license

This commit is contained in:
Tristan Yang
2022-07-12 17:48:28 +08:00
parent cb80f87033
commit ab9e1b9e54
5 changed files with 99 additions and 18 deletions
+8 -2
View File
@@ -194,6 +194,11 @@ export const serverApi = createApi({
url: `/admin/system/initialized`
})
}),
getLicense: builder.query<LicenseResponse, void>({
query: () => ({
url: `/license`
})
}),
checkLicense: builder.mutation<LicenseResponse, string>({
query: (license) => ({
@@ -205,7 +210,7 @@ export const serverApi = createApi({
upsertLicense: builder.mutation<boolean, string>({
query: (license) => ({
url: "/license/save",
method: "POST",
method: "PUT",
body: { license }
})
})
@@ -241,5 +246,6 @@ export const {
useCreateAdminMutation,
useGetInitializedQuery,
useUpsertLicenseMutation,
useCheckLicenseMutation
useCheckLicenseMutation,
useGetLicenseQuery
} = serverApi;