refactor
This commit is contained in:
@@ -87,7 +87,7 @@ export async function authorization(
|
|||||||
});
|
});
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
let parsed = await response.json();
|
let parsed = await response.json();
|
||||||
if (parsed.message_desc === 'Operation successful') {
|
if (parsed.message_code === 0) {
|
||||||
await createSession(parsed.message_body.token, email);
|
await createSession(parsed.message_body.token, email);
|
||||||
} else {
|
} else {
|
||||||
throw (`${parsed.message_code}`);
|
throw (`${parsed.message_code}`);
|
||||||
@@ -225,10 +225,10 @@ export async function registration(
|
|||||||
let parsed = await response.json() as {
|
let parsed = await response.json() as {
|
||||||
message_desc: string,
|
message_desc: string,
|
||||||
message_body: { token: string },
|
message_body: { token: string },
|
||||||
message_code: string
|
message_code: number
|
||||||
};
|
};
|
||||||
|
|
||||||
if (parsed.message_desc === 'Operation successful') {
|
if (parsed.message_code === 0) {
|
||||||
console.log(`registration - ${accountType}`);
|
console.log(`registration - ${accountType}`);
|
||||||
console.log({
|
console.log({
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
|
|||||||
Reference in New Issue
Block a user