-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from Aar-if/newaltv1
Batching fix
- Loading branch information
Showing
6 changed files
with
112 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import axios from "axios"; | ||
import { studentReset } from "../routes/links"; | ||
|
||
const studentAPI = async (data) => { | ||
const token = localStorage.getItem("token"); | ||
|
||
const headers = { | ||
"Accept-Language": "en-GB,en;q=0.9", | ||
Authorization: `Bearer ${token}`, | ||
Connection: "keep-alive", | ||
"Content-Type": "application/json", | ||
}; | ||
|
||
const jsonData = { | ||
username: data.username, | ||
newPassword: data.newPassword, | ||
}; | ||
|
||
let result; | ||
await axios({ | ||
method: "POST", | ||
url: studentReset, | ||
data: jsonData, | ||
headers: headers, | ||
}) | ||
.then((res) => { | ||
console.log(res); | ||
console.log(res.data); | ||
console.log(res.status); | ||
if (res.status === 201) { | ||
result = true; | ||
} else { | ||
result = false; | ||
} | ||
}) | ||
.catch(function (error) { | ||
let err = 0; | ||
return err; | ||
}); | ||
|
||
return result; | ||
}; | ||
|
||
export default studentAPI; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from "react"; | ||
|
||
function StudentResetPassword() { | ||
return <div>StudentResetPassword</div>; | ||
} | ||
|
||
export default StudentResetPassword; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters