fix: [CAL-3374] Says Number is not Verified, but it is Verified (#14531)
* fix: [CAL-3374] Says Number is not Verified, but it is Verified * clearing error only when verified * type-checks fixed * chore: improvement --------- Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
88 files changed
+109
-126
No files matched your search
@@ -15,7 +15,7 @@ interface IDeleteDialog {
|
||||
export const DeleteDialog = (props: IDeleteDialog) => {
|
||||
const { t } = useLocale();
|
||||
const { isOpenDialog, setIsOpenDialog, workflowId, additionalFunction } = props;
|
||||
const utils = trpc.useContext();
|
||||
const utils = trpc.useUtils();
|
||||
|
||||
const deleteMutation = trpc.viewer.workflows.delete.useMutation({
|
||||
onSuccess: async () => {
|
||||
|
||||
@@ -43,7 +43,7 @@ const WorkflowListItem = (props: ItemProps) => {
|
||||
);
|
||||
|
||||
const isActive = activeEventTypeIds.includes(eventType.id);
|
||||
const utils = trpc.useContext();
|
||||
const utils = trpc.useUtils();
|
||||
|
||||
const activateEventTypeMutation = trpc.viewer.workflows.activateEventType.useMutation({
|
||||
onSuccess: async () => {
|
||||
|
||||
@@ -52,7 +52,7 @@ interface Props {
|
||||
}
|
||||
export default function WorkflowListPage({ workflows }: Props) {
|
||||
const { t } = useLocale();
|
||||
const utils = trpc.useContext();
|
||||
const utils = trpc.useUtils();
|
||||
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
||||
const [workflowToDeleteId, setwWorkflowToDeleteId] = useState(0);
|
||||
const [parent] = useAutoAnimate<HTMLUListElement>();
|
||||
@@ -252,12 +252,7 @@ export default function WorkflowListPage({ workflows }: Props) {
|
||||
<div className="block sm:hidden">
|
||||
<Dropdown>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
type="button"
|
||||
color="minimal"
|
||||
variant="icon"
|
||||
StartIcon="ellipsis"
|
||||
/>
|
||||
<Button type="button" color="minimal" variant="icon" StartIcon="ellipsis" />
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent>
|
||||
<DropdownMenuItem>
|
||||
|
||||
@@ -71,7 +71,7 @@ type WorkflowStepProps = {
|
||||
|
||||
export default function WorkflowStepContainer(props: WorkflowStepProps) {
|
||||
const { t } = useLocale();
|
||||
const utils = trpc.useContext();
|
||||
const utils = trpc.useUtils();
|
||||
|
||||
const { step, form, reload, setReload, teamId } = props;
|
||||
const { data: _verifiedNumbers } = trpc.viewer.workflows.getVerifiedNumbers.useQuery(
|
||||
@@ -216,6 +216,15 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
|
||||
onSuccess: async (isVerified) => {
|
||||
showToast(isVerified ? t("verified_successfully") : t("wrong_code"), "success");
|
||||
setNumberVerified(isVerified);
|
||||
if (
|
||||
step &&
|
||||
form?.formState?.errors?.steps &&
|
||||
form.formState.errors.steps[step.stepNumber - 1]?.sendTo &&
|
||||
isVerified
|
||||
) {
|
||||
form.clearErrors(`steps.${step.stepNumber - 1}.sendTo`);
|
||||
}
|
||||
|
||||
utils.viewer.workflows.getVerifiedNumbers.invalidate();
|
||||
},
|
||||
onError: (err) => {
|
||||
|
||||
@@ -100,7 +100,7 @@ function WorkflowPage() {
|
||||
});
|
||||
|
||||
const { workflow: workflowId } = params ? querySchema.parse(params) : { workflow: -1 };
|
||||
const utils = trpc.useContext();
|
||||
const utils = trpc.useUtils();
|
||||
|
||||
const userQuery = useMeQuery();
|
||||
const user = userQuery.data;
|
||||
|
||||
Reference in new issue
Block a user