diff --git a/src/pages/company/service/detail/components/QuotationTemplate.jsx b/src/pages/company/service/detail/components/QuotationTemplate.jsx index 4f1a9da..aca2821 100644 --- a/src/pages/company/service/detail/components/QuotationTemplate.jsx +++ b/src/pages/company/service/detail/components/QuotationTemplate.jsx @@ -14,7 +14,6 @@ const QuotationTemplate = ({ id, isView, onCancel,isEdit }) => { const [categories, setCategories] = useState([]); useEffect(() => { - console.log(id,'id'); if (id) { fetchServiceTemplate(); @@ -29,7 +28,7 @@ const QuotationTemplate = ({ id, isView, onCancel,isEdit }) => { filter: { id: { eq: id }, type: { eq: 'serviceTemplate' }, - 'attributes->>type': { eq: 'quotation' } + 'attributes->>template_type': { eq: 'quotation' } } }); console.log(data,'data'); @@ -58,7 +57,7 @@ const QuotationTemplate = ({ id, isView, onCancel,isEdit }) => { const { data } = await supabaseService.select('resources', { filter: { type: { eq: 'categories' }, - 'attributes->>template_type': { eq: 'quotation' } + 'attributes->>template_type': { in: `(quotation,common)` } }, order: { column: 'created_at', @@ -96,7 +95,7 @@ const QuotationTemplate = ({ id, isView, onCancel,isEdit }) => { const serviceData = { type: "serviceTemplate", attributes: { - type: "quotation", + template_type: "quotation", templateName: values.templateName, description: values.description, sections: values.sections, diff --git a/src/pages/company/service/index.jsx b/src/pages/company/service/index.jsx index c66a0b0..07f834d 100644 --- a/src/pages/company/service/index.jsx +++ b/src/pages/company/service/index.jsx @@ -441,7 +441,7 @@ const ServicePage = () => { text: value.label, value: key, })), - onFilter: (value, record) => record.attributes.type === value, + onFilter: (value, record) => record.attributes.template_type === value, render: (type) => { const typeConfig = TEMPLATE_TYPES[type]; return typeConfig ? ( @@ -497,7 +497,7 @@ const ServicePage = () => { type="link" onClick={() => handleNavigateToTemplate( - record.attributes.type, + record.attributes.template_type, record.id, "isView" ) @@ -509,7 +509,7 @@ const ServicePage = () => { type="link" onClick={() => handleNavigateToTemplate( - record.attributes.type, + record.attributes.template_type, record.id, "edit" )