Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"react-dom": "^18.3.1",
"react-router-dom": "^6.23.1",
"react-rte": "^0.16.5",
"react-syntax-highlighter": "^15.5.0"
"react-syntax-highlighter": "^15.5.0",
"yup": "^1.6.1"
},
"devDependencies": {
"@faker-js/faker": "^8.4.1",
Expand Down
13 changes: 8 additions & 5 deletions src/api/endpoints/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,16 @@ export const addMessateToVariantDiscussion = async (group, variantID, message) =
});
}

export const handleLogin = async (email: string, password: string) => {
export const handleLogin = async (username: string, password: string) => {
try {
const { postOpsUserLogin } = useApi()
const response = await postOpsUserLogin({
email,
password,
data: {
username,
password,
},
});
console.log("Login successful:", response);
return response.data;
} catch (error) {
console.error("Login failed:", error);
throw error;
Expand All @@ -364,6 +365,7 @@ export const handleLogin = async (email: string, password: string) => {
export const handleRegister = async (
firstName: string,
lastName: string,
username: string,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the these properties exists in the AxiosRequestConfig

email: string,
password: string,
organization: string
Expand All @@ -373,6 +375,7 @@ export const handleRegister = async (
const response = await postOpsUserNew({
firstName,
lastName,
username,
email,
password,
organization,
Expand Down Expand Up @@ -411,4 +414,4 @@ export const handleRecoverUser = async (email: string) => {
console.error("Recover user failed:", error);
throw error;
}
};
};
Loading
Loading