Skip to content

Commit

Permalink
update registration
Browse files Browse the repository at this point in the history
  • Loading branch information
birdpump committed Apr 4, 2024
1 parent 4e2595f commit 249044d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/routes/(app)/register/views/View1.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
if ($singleLocker) {
try {
let response = await validateID(student1);
if (response.status === 404) {
if (response.status === 400) {
input1.style.borderColor = "red";
input1.value = "";
input1.placeholder = "Student Error"; //todo this should get a message from the server
input1.placeholder = "Invalid ID"; //todo this should get a message from the server
} else if (response.ok) {
studentId1.set(studentId1);
Expand All @@ -44,12 +44,13 @@
let responses = [];
let status = true;
if(student1 === student2) status = false;
try {
let response = await validateID(student1);
if (response.status === 404) {
if (response.status === 400) {
input1.style.borderColor = "red";
input1.value = "";
input1.placeholder = "Student Error"; //todo this should get a message from the server
input1.placeholder = "Invalid ID"; //todo this should get a message from the server
} else if (response.ok) {
studentId1.set(student1);
responses[0] = await response.json();
Expand All @@ -64,10 +65,10 @@
//student 2
try {
let response = await validateID(student2);
if (response.status === 404) {
if (response.status === 400) {
input2.style.borderColor = "red";
input2.value = "";
input2.placeholder = "Student Error"; //todo this should get a message from the server
input2.placeholder = "Invalid ID"; //todo this should get a message from the server
} else if (response.ok) {
studentId2.set(student2);
responses[1] = await response.json();
Expand Down

0 comments on commit 249044d

Please sign in to comment.