feat: API config

This commit is contained in:
zerosoul
2022-04-19 11:18:13 +08:00
parent 998abd220b
commit 04e279fe0c
3 changed files with 57 additions and 0 deletions
+21
View File
@@ -22,6 +22,25 @@ export const serverApi = createApi({
}
},
}),
getThirdPartySecret: builder.query({
query: () => ({
// headers: {
// "content-type": "text/plain",
// accept: "text/plain",
// },
url: `/admin/system/third_party_secret`,
responseHandler: (response) => response.text(),
}),
keepUnusedDataFor: 0,
}),
updateThirdPartySecret: builder.mutation({
query: () => ({
url: `/admin/system/third_party_secret`,
method: "POST",
responseHandler: (response) => response.text(),
}),
}),
getMetrics: builder.query({
query: () => ({ url: `/admin/system/metrics` }),
}),
@@ -145,4 +164,6 @@ export const {
useUpdateLogoMutation,
useCreateInviteLinkQuery,
useLazyCreateInviteLinkQuery,
useGetThirdPartySecretQuery,
useUpdateThirdPartySecretMutation,
} = serverApi;