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