mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
Added basicData endpoint & refactorize profileData
This commit is contained in:
parent
005b6a41c9
commit
b500171b01
@ -6,5 +6,6 @@ export default {
|
||||
post_actions: 'POST /post-actions',
|
||||
|
||||
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
|
||||
}
|
||||
},
|
||||
profileData: (parms, callback) => {
|
||||
basicData: (parms, callback) => {
|
||||
if (!parms) return false
|
||||
|
||||
const { username } = parms
|
||||
@ -49,7 +49,7 @@ export const get = {
|
||||
v3_model.api_request(
|
||||
{
|
||||
body: { username },
|
||||
endpoint: endpoints.profileData,
|
||||
endpoint: endpoints.basicData,
|
||||
verbose: true,
|
||||
},
|
||||
(err, res) => {
|
||||
@ -63,6 +63,31 @@ export const get = {
|
||||
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 = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user