Updates
This commit is contained in:
+1
-3
@@ -17,7 +17,5 @@ type Param<T = {
|
||||
*/
|
||||
export default function queryDSQLAPI<T = {
|
||||
[k: string]: any;
|
||||
}, P = {
|
||||
[k: string]: any;
|
||||
}>({ body, query, useDefault, path: passedPath, method, apiKey, apiConnectionConfig, grabbedHostnames, }: Param<T>): Promise<APIResponseObject<P>>;
|
||||
}>({ body, query, useDefault, path: passedPath, method, apiKey, apiConnectionConfig, grabbedHostnames, }: Param<T>): Promise<APIResponseObject>;
|
||||
export {};
|
||||
|
||||
@@ -121,8 +121,8 @@ function handleSocialDb(_a) {
|
||||
duplicateColumnValue: finalEmail,
|
||||
data: Object.assign(Object.assign({}, data), { email: finalEmail }),
|
||||
});
|
||||
if ((_b = newUser === null || newUser === void 0 ? void 0 : newUser.payload) === null || _b === void 0 ? void 0 : _b.insertId) {
|
||||
const newUserQueriedQuery = `SELECT * FROM users WHERE id='${newUser.payload.insertId}'`;
|
||||
if ((_b = newUser === null || newUser === void 0 ? void 0 : newUser.postInsertReturn) === null || _b === void 0 ? void 0 : _b.insertId) {
|
||||
const newUserQueriedQuery = `SELECT * FROM users WHERE id='${newUser.postInsertReturn.insertId}'`;
|
||||
const newUserQueried = (yield (0, dbHandler_1.default)({
|
||||
database: finalDbName,
|
||||
query: newUserQueriedQuery,
|
||||
@@ -141,7 +141,7 @@ function handleSocialDb(_a) {
|
||||
*/
|
||||
let generatedToken = (0, encrypt_1.default)({
|
||||
data: JSON.stringify({
|
||||
id: newUser.payload.insertId,
|
||||
id: newUser.postInsertReturn.insertId,
|
||||
email: supEmail,
|
||||
dateCode: Date.now(),
|
||||
}),
|
||||
|
||||
@@ -138,8 +138,8 @@ function apiCreateUser(_a) {
|
||||
"/images/user-preset.png", image_thumbnail: process.env.DSQL_DEFAULT_USER_IMAGE ||
|
||||
"/images/user-preset-thumbnail.png", verification_status: verify ? 1 : 0 }),
|
||||
});
|
||||
if ((_b = addUser === null || addUser === void 0 ? void 0 : addUser.payload) === null || _b === void 0 ? void 0 : _b.insertId) {
|
||||
const newlyAddedUserQuery = `SELECT id,uuid,first_name,last_name,email,username,image,image_thumbnail,verification_status FROM ${dbFullName}.users WHERE id='${addUser.payload.insertId}'`;
|
||||
if ((_b = addUser === null || addUser === void 0 ? void 0 : addUser.postInsertReturn) === null || _b === void 0 ? void 0 : _b.insertId) {
|
||||
const newlyAddedUserQuery = `SELECT id,uuid,first_name,last_name,email,username,image,image_thumbnail,verification_status FROM ${dbFullName}.users WHERE id='${addUser.postInsertReturn.insertId}'`;
|
||||
const newlyAddedUser = (yield (0, dbHandler_1.default)({
|
||||
query: newlyAddedUserQuery,
|
||||
values: [],
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ function apiLoginUser(_a) {
|
||||
const resposeObject = {
|
||||
success: true,
|
||||
msg: "Login Successful",
|
||||
payload: userPayload,
|
||||
singleRes: userPayload,
|
||||
userId: foundUser[0].id,
|
||||
csrf: csrfKey,
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@ function apiResetUserPassword(_a) {
|
||||
});
|
||||
return {
|
||||
success: true,
|
||||
payload: updateUser,
|
||||
singleRes: updateUser,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ function apiUpdateUser(_a) {
|
||||
});
|
||||
return {
|
||||
success: true,
|
||||
payload: updateUser,
|
||||
singleRes: updateUser,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { APILoginFunctionReturn } from "../../../../types";
|
||||
import { APIResponseObject } from "../../../../types";
|
||||
type Param = {
|
||||
code?: string;
|
||||
clientId?: string;
|
||||
@@ -13,5 +13,5 @@ type Param = {
|
||||
/**
|
||||
* # API Login with Github
|
||||
*/
|
||||
export default function apiGithubLogin({ code, clientId, clientSecret, database, additionalFields, email, additionalData, }: Param): Promise<APILoginFunctionReturn>;
|
||||
export default function apiGithubLogin({ code, clientId, clientSecret, database, additionalFields, email, additionalData, }: Param): Promise<APIResponseObject>;
|
||||
export {};
|
||||
|
||||
Reference in New Issue
Block a user