Skip to content

Commit

Permalink
add new verification update
Browse files Browse the repository at this point in the history
  • Loading branch information
birdpump committed Apr 5, 2024
1 parent 5a2ad0c commit 4b0408c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/lib/services/app/mainApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export async function fetchEnabledGrades() {
return await response.json();
}

export async function sendVerification(data){
return await fetch(`https://locker-api.cvapps.net/public/send-verify-student/${data}`, {
method: "post",
});
}

export async function checkVerification(data){
return await fetch(`https://locker-api.cvapps.net/public/check-verification/${data}`, {
method: "get",
Expand Down
5 changes: 4 additions & 1 deletion src/routes/(app)/register/views/View1.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import {createEventDispatcher} from "svelte";
import {slide} from "svelte/transition";
import {quartOut} from "svelte/easing";
import {validateID} from "$lib/services/app/mainApi.js";
import {validateID, sendVerification} from "$lib/services/app/mainApi.js";
import {singleLocker, studentId1, studentId2, pageView} from "../store.js";
const dispatch = createEventDispatcher();
Expand Down Expand Up @@ -32,6 +32,7 @@
input1.placeholder = jsonResponse.error;
} else if (response.ok) {
studentId1.set(student1);
await sendVerification($studentId1);
pageView.set(2);
}
} catch (error) {
Expand Down Expand Up @@ -84,6 +85,8 @@
//once both all good, send the response
if (status) {
await sendVerification($studentId1);
await sendVerification($studentId2);
pageView.set(2);
}
Expand Down

0 comments on commit 4b0408c

Please sign in to comment.