Ver Fonte

feat(support): adiciona validacao de suporte

ebagabee há 3 semanas atrás
pai
commit
96334e2caf

+ 0 - 1
src/pages/support/SupportPage.vue

@@ -115,7 +115,6 @@ const originLabel = (row) => {
 };
 
 const targetLabel = (row) => {
-  if (row.scope === "all") return "Todas as Unidades";
   if (row.scope === "internal") return "Interno";
   return row.target_unit_name ?? "—";
 };

+ 15 - 11
src/pages/support/components/AddEditTicketDialog.vue

@@ -226,17 +226,21 @@ const form = ref({
   description: ticket?.description ?? null,
 });
 
-const buildPayload = () => ({
-  title: form.value.title,
-  severity: form.value.severity,
-  scope: form.value.scope,
-  sector: form.value.sector || null,
-  description: form.value.description || null,
-  target_unit_id:
-    form.value.scope === "specific"
-      ? (selectedUnit.value?.value ?? null)
-      : null,
-});
+const buildPayload = () => {
+  const payload = {
+    title: form.value.title,
+    severity: form.value.severity,
+    scope: form.value.scope,
+    sector: form.value.sector || null,
+    description: form.value.description || null,
+  };
+
+  if (form.value.scope === "specific") {
+    payload.target_unit_id = selectedUnit.value?.value ?? null;
+  }
+
+  return payload;
+};
 
 const onAddComment = () => {
   $q.dialog({