mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-08 10:00:12 -05:00
Removed redundant code and files
This commit is contained in:
@@ -182,11 +182,6 @@ const handleForgotRejected = (state, action) => {
|
|||||||
? action.payload.msg
|
? action.payload.msg
|
||||||
: "Failed to send reset instructions.";
|
: "Failed to send reset instructions.";
|
||||||
};
|
};
|
||||||
const handleNewPasswordFulfilled = (state, action) => {
|
|
||||||
state.isLoading = false;
|
|
||||||
state.success = action.payload.success;
|
|
||||||
state.msg = action.payload.msg;
|
|
||||||
};
|
|
||||||
const handleNewPasswordRejected = (state, action) => {
|
const handleNewPasswordRejected = (state, action) => {
|
||||||
state.isLoading = false;
|
state.isLoading = false;
|
||||||
state.success = false;
|
state.success = false;
|
||||||
@@ -253,7 +248,7 @@ const authSlice = createSlice({
|
|||||||
.addCase(setNewPassword.pending, (state) => {
|
.addCase(setNewPassword.pending, (state) => {
|
||||||
state.isLoading = true;
|
state.isLoading = true;
|
||||||
})
|
})
|
||||||
.addCase(setNewPassword.fulfilled, handleNewPasswordFulfilled)
|
.addCase(setNewPassword.fulfilled, handleAuthFulfilled)
|
||||||
.addCase(setNewPassword.rejected, handleNewPasswordRejected);
|
.addCase(setNewPassword.rejected, handleNewPasswordRejected);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -73,72 +73,6 @@ const credentials = joi.object({
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
const registerValidation = joi.object({
|
|
||||||
firstname: joi.string().required().messages({
|
|
||||||
"string.empty": "First name is required",
|
|
||||||
}),
|
|
||||||
|
|
||||||
lastname: joi.string().required().messages({
|
|
||||||
"string.empty": "Last name is required",
|
|
||||||
}),
|
|
||||||
|
|
||||||
email: joi
|
|
||||||
.string()
|
|
||||||
.email({ tlds: { allow: false } })
|
|
||||||
.required()
|
|
||||||
.messages({
|
|
||||||
"string.email": "Email must be a valid email",
|
|
||||||
"string.empty": "Email is required",
|
|
||||||
}),
|
|
||||||
|
|
||||||
password: joi.string().min(8).required().messages({
|
|
||||||
"string.min": "Password must be at least 8 characters",
|
|
||||||
"string.empty": "Password is required",
|
|
||||||
}),
|
|
||||||
role: joi.string().required().messages({
|
|
||||||
"string.empty": "Role is required",
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
const loginValidation = joi.object({
|
|
||||||
email: joi
|
|
||||||
.string()
|
|
||||||
.email({ tlds: { allow: false } })
|
|
||||||
.required()
|
|
||||||
.messages({
|
|
||||||
"string.email": "Email must be a valid email",
|
|
||||||
"string.empty": "Email is required",
|
|
||||||
}),
|
|
||||||
|
|
||||||
password: joi.string().min(8).required().messages({
|
|
||||||
"string.min": "Password must be at least 8 characters",
|
|
||||||
"string.empty": "Password is required",
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
const recoveryValidation = joi.object({
|
|
||||||
email: joi
|
|
||||||
.string()
|
|
||||||
.email({ tlds: { allow: false } })
|
|
||||||
.required()
|
|
||||||
.messages({
|
|
||||||
"string.email": "Email must be a valid email",
|
|
||||||
"string.empty": "Email is required",
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
const newPasswordValidation = joi.object({
|
|
||||||
password: joi.string().min(8).required().messages({
|
|
||||||
"string.min": "Password must be at least 8 characters",
|
|
||||||
"string.empty": "Password is required",
|
|
||||||
}),
|
|
||||||
confirm: joi.string().valid(joi.ref("password")).min(8).required().messages({
|
|
||||||
"string.min": "Password must be at least 8 characters",
|
|
||||||
"string.empty": "Password is required",
|
|
||||||
"any.only": "Passwords do not match",
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
const createMonitorValidation = joi.object({
|
const createMonitorValidation = joi.object({
|
||||||
url: joi
|
url: joi
|
||||||
.string()
|
.string()
|
||||||
@@ -172,12 +106,4 @@ const imageValidation = joi.object({
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
export {
|
export { credentials, imageValidation, createMonitorValidation };
|
||||||
credentials,
|
|
||||||
imageValidation,
|
|
||||||
createMonitorValidation,
|
|
||||||
registerValidation,
|
|
||||||
loginValidation,
|
|
||||||
recoveryValidation,
|
|
||||||
newPasswordValidation,
|
|
||||||
};
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.4 KiB |
Reference in New Issue
Block a user