feat: camelCase compatible API

This commit is contained in:
Sebastian Pravda 2022-11-30 15:31:14 +01:00 committed by EETagent
parent e8328f94a3
commit fb1c83c6a8
3 changed files with 3 additions and 3 deletions

View file

@ -6,7 +6,7 @@ import { API_URL, errorHandler } from ".";
export async function apiLogin(data: CandidateLogin): Promise<number> { export async function apiLogin(data: CandidateLogin): Promise<number> {
try { try {
let res = await axios.post(API_URL + '/candidate/login', data, {withCredentials: true}); let res = await axios.post(API_URL + '/candidate/login', data, {withCredentials: true});
return data.application_id; return data.applicationId;
} catch (e: any) { } catch (e: any) {
throw errorHandler(e, "Login failed"); throw errorHandler(e, "Login failed");
} }

View file

@ -44,7 +44,7 @@
async function submit() { async function submit() {
try { try {
await login({application_id: applicationId, password: codeValueMobile}); await login({applicationId, password: codeValueMobile});
goto("/register"); goto("/register");
} catch (e) { } catch (e) {
console.error(e); console.error(e);

View file

@ -21,7 +21,7 @@ export interface CandidateData {
} }
export interface CandidateLogin { export interface CandidateLogin {
application_id: number; applicationId: number;
password: string; password: string;
} }