mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
Added basicData endpoint & refactorize profileData
This commit is contained in:
parent
fbb3c2609b
commit
a059a510f2
@ -6,5 +6,6 @@ export default {
|
|||||||
post_actions: 'POST /post-actions',
|
post_actions: 'POST /post-actions',
|
||||||
|
|
||||||
get_data: 'POST /get-user-data',
|
get_data: 'POST /get-user-data',
|
||||||
profileData: 'POST /early_user'
|
basicData: 'POST /early_user',
|
||||||
|
profileData: 'POST /get-user-data-username'
|
||||||
};
|
};
|
||||||
|
@ -40,7 +40,7 @@ export const get = {
|
|||||||
// core get id data from current session
|
// core get id data from current session
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
profileData: (parms, callback) => {
|
basicData: (parms, callback) => {
|
||||||
if (!parms) return false
|
if (!parms) return false
|
||||||
|
|
||||||
const { username } = parms
|
const { username } = parms
|
||||||
@ -49,7 +49,7 @@ export const get = {
|
|||||||
v3_model.api_request(
|
v3_model.api_request(
|
||||||
{
|
{
|
||||||
body: { username },
|
body: { username },
|
||||||
endpoint: endpoints.profileData,
|
endpoint: endpoints.basicData,
|
||||||
verbose: true,
|
verbose: true,
|
||||||
},
|
},
|
||||||
(err, res) => {
|
(err, res) => {
|
||||||
@ -63,6 +63,31 @@ export const get = {
|
|||||||
return callback(res, false);
|
return callback(res, false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
profileData: (parms, callback) => {
|
||||||
|
if (!parms) return false
|
||||||
|
|
||||||
|
const { username, server_key, access_token } = parms
|
||||||
|
|
||||||
|
if (username) {
|
||||||
|
v3_model.api_request(
|
||||||
|
{
|
||||||
|
body: { username, fetch: "user_data" },
|
||||||
|
endpoint: endpoints.profileData,
|
||||||
|
userToken: access_token,
|
||||||
|
verbose: true,
|
||||||
|
serverKey: server_key
|
||||||
|
},
|
||||||
|
(err, res) => {
|
||||||
|
err? console.error(err) : null
|
||||||
|
return callback(false, res);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
const res = { status: 105, message: 'Invalid Username!' };
|
||||||
|
return callback(res, false);
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const actions = {
|
export const actions = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user