Updates
This commit is contained in:
@@ -22,8 +22,7 @@ export type ApiGetParams = Param;
|
||||
* # Make a get request to Datasquirel API
|
||||
*/
|
||||
export default async function get<
|
||||
T extends { [k: string]: any } = { [k: string]: any },
|
||||
R extends any = any
|
||||
T extends { [k: string]: any } = { [k: string]: any }
|
||||
>({
|
||||
key,
|
||||
database,
|
||||
@@ -32,7 +31,7 @@ export default async function get<
|
||||
debug,
|
||||
useLocal,
|
||||
apiVersion = "v1",
|
||||
}: Param<T>): Promise<APIResponseObject<R>> {
|
||||
}: Param<T>): Promise<APIResponseObject> {
|
||||
const grabedHostNames = grabHostNames();
|
||||
const { host, port, scheme } = grabedHostNames;
|
||||
|
||||
@@ -122,5 +121,5 @@ export default async function get<
|
||||
.end();
|
||||
});
|
||||
|
||||
return httpResponse as APIResponseObject<R>;
|
||||
return httpResponse as APIResponseObject;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ export default async function loginUser<
|
||||
secureCookie,
|
||||
useLocal,
|
||||
apiVersion = "v1",
|
||||
}: LoginUserParam): Promise<APIResponseObject<T | null>> {
|
||||
}: LoginUserParam): Promise<APIResponseObject> {
|
||||
const COOKIE_EXPIRY_DATE = grabCookieExpiryDate();
|
||||
|
||||
const defaultTempLoginFieldName = "temp_login_code";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ResetPasswordParams, UpdateUserFunctionReturn } from "../../types";
|
||||
import { APIResponseObject, ResetPasswordParams } from "../../types";
|
||||
import queryDSQLAPI from "../../functions/api/query-dsql-api";
|
||||
import grabUserDSQLAPIPath from "../../utils/backend/users/grab-api-path";
|
||||
import apiResetUserPassword from "../../functions/api/users/api-reset-user-password";
|
||||
@@ -8,7 +8,7 @@ import apiResetUserPassword from "../../functions/api/users/api-reset-user-passw
|
||||
*/
|
||||
export default async function resetPassword(
|
||||
params: ResetPasswordParams
|
||||
): Promise<UpdateUserFunctionReturn> {
|
||||
): Promise<APIResponseObject> {
|
||||
if (params.useLocal) {
|
||||
return await apiResetUserPassword(params);
|
||||
}
|
||||
@@ -25,5 +25,5 @@ export default async function resetPassword(
|
||||
method: "POST",
|
||||
});
|
||||
|
||||
return httpResponse as UpdateUserFunctionReturn;
|
||||
return httpResponse as APIResponseObject;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import apiUpdateUser from "../../functions/api/users/api-update-user";
|
||||
import {
|
||||
APIResponseObject,
|
||||
ApiUpdateUserParams,
|
||||
UpdateUserFunctionReturn,
|
||||
UpdateUserParams,
|
||||
@@ -23,7 +24,7 @@ export default async function updateUser<
|
||||
apiKey,
|
||||
apiVersion,
|
||||
dbUserId,
|
||||
}: UpdateUserParams<T>): Promise<UpdateUserFunctionReturn> {
|
||||
}: UpdateUserParams<T>): Promise<APIResponseObject> {
|
||||
const updateUserParams: ApiUpdateUserParams = {
|
||||
payload: payload,
|
||||
database,
|
||||
@@ -52,5 +53,5 @@ export default async function updateUser<
|
||||
method: "POST",
|
||||
});
|
||||
|
||||
return httpResponse as UpdateUserFunctionReturn;
|
||||
return httpResponse as APIResponseObject;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user