refactor: add typescript support to project

This commit is contained in:
HD
2022-06-29 16:54:58 +08:00
parent ccfee28e13
commit 003353e43f
33 changed files with 358 additions and 224 deletions
+5 -3
View File
@@ -51,7 +51,7 @@ export const authApi = createApi({
}
}
}),
register: builder.mutation({
register: builder.mutation<any, any>({
query: (data) => ({
url: `user/register`,
method: "POST",
@@ -143,10 +143,12 @@ export const authApi = createApi({
url: `/user/check_email?email=${encodeURIComponent(email)}`
})
}),
getCredentials: builder.query({
// todo: check return type
getCredentials: builder.query<any, void>({
query: () => ({ url: "/token/credentials" })
}),
logout: builder.query({
// todo: check return type
logout: builder.query<any, void>({
query: () => ({ url: "token/logout" }),
async onQueryStarted(params, { dispatch, queryFulfilled }) {
try {