Skip to content

Commit d584601

Browse files
committed
old: Sync with the new API structure
New API structure mandates res.msg to always exist. ``` interface ResponseAPI<Data> { code: number; res: Data & { msg: string; renew_token?: RenewTokenResponse; }; } ``` See the discussion in the link below. Link: https://t.me/GNUWeeb/1138948 Signed-off-by: Ammar Faizi <[email protected]>
1 parent 3c3c00f commit d584601

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

old/assets/js/api.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function gwm_cb_login(j)
109109
LS.setItem("gwm_token", r.token);
110110
LS.setItem("gwm_token_exp_at", r.token_exp_at);
111111
LS.setItem("gwm_uinfo", JSON.stringify(r.user_info));
112-
alert("Login successful!");
112+
alert(j.msg);
113113
window.location.href = "home.html";
114114
}
115115

@@ -125,7 +125,7 @@ function gwm_cb_change_password(j)
125125
return false;
126126
}
127127

128-
alert("Password changed successfully!");
128+
alert(j.res.msg);
129129
return true;
130130
}
131131

@@ -147,7 +147,7 @@ function gwm_fn_change_password(cb, cur_pass, new_pass, retype_new_pass)
147147
function gwm_fn_set_user_info(cb, data)
148148
{
149149
let callback = function (j) {
150-
alert(j.res);
150+
alert(j.res.msg);
151151
if (cb)
152152
cb(j);
153153
};

0 commit comments

Comments
 (0)