fix: improve inquiry status change and notification refresh
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
Block no-op inquiry status updates, refetch active my-notifications after create, and use the shared error text token on Select validation messages. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -11,14 +11,12 @@ interface ChangeStatusFormProps {
|
||||
onSubmit: (data: TChangeInquiryStatusCredentials) => void;
|
||||
onCancel: () => void;
|
||||
currentStatus: string;
|
||||
|
||||
}
|
||||
|
||||
const ChangeStatusForm = ({
|
||||
onSubmit,
|
||||
onCancel,
|
||||
currentStatus,
|
||||
|
||||
}: ChangeStatusFormProps) => {
|
||||
const {
|
||||
register,
|
||||
@@ -37,10 +35,19 @@ const ChangeStatusForm = ({
|
||||
value: status,
|
||||
}));
|
||||
|
||||
const handleStatusSubmit = (data: TChangeInquiryStatusCredentials) => {
|
||||
if (data.status === currentStatus) return;
|
||||
onSubmit(data);
|
||||
};
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSubmit(onSubmit)} className="space-y-4">
|
||||
<form onSubmit={handleSubmit(handleStatusSubmit)} className="space-y-4">
|
||||
<Select
|
||||
{...register("status", { required: "Status is required" })}
|
||||
{...register("status", {
|
||||
required: "Status is required",
|
||||
validate: (value) =>
|
||||
value !== currentStatus || "Select a different status",
|
||||
})}
|
||||
name="status"
|
||||
label="Status"
|
||||
items={statusOptions}
|
||||
|
||||
Reference in New Issue
Block a user