This commit is contained in:
liamzi
2024-12-27 18:24:34 +08:00
parent bbdcaccd7b
commit 2b71b25722
2 changed files with 6 additions and 7 deletions

View File

@@ -14,7 +14,6 @@ const QuotationTemplate = ({ id, isView, onCancel,isEdit }) => {
const [categories, setCategories] = useState([]); const [categories, setCategories] = useState([]);
useEffect(() => { useEffect(() => {
console.log(id,'id');
if (id) { if (id) {
fetchServiceTemplate(); fetchServiceTemplate();
@@ -29,7 +28,7 @@ const QuotationTemplate = ({ id, isView, onCancel,isEdit }) => {
filter: { filter: {
id: { eq: id }, id: { eq: id },
type: { eq: 'serviceTemplate' }, type: { eq: 'serviceTemplate' },
'attributes->>type': { eq: 'quotation' } 'attributes->>template_type': { eq: 'quotation' }
} }
}); });
console.log(data,'data'); console.log(data,'data');
@@ -58,7 +57,7 @@ const QuotationTemplate = ({ id, isView, onCancel,isEdit }) => {
const { data } = await supabaseService.select('resources', { const { data } = await supabaseService.select('resources', {
filter: { filter: {
type: { eq: 'categories' }, type: { eq: 'categories' },
'attributes->>template_type': { eq: 'quotation' } 'attributes->>template_type': { in: `(quotation,common)` }
}, },
order: { order: {
column: 'created_at', column: 'created_at',
@@ -96,7 +95,7 @@ const QuotationTemplate = ({ id, isView, onCancel,isEdit }) => {
const serviceData = { const serviceData = {
type: "serviceTemplate", type: "serviceTemplate",
attributes: { attributes: {
type: "quotation", template_type: "quotation",
templateName: values.templateName, templateName: values.templateName,
description: values.description, description: values.description,
sections: values.sections, sections: values.sections,

View File

@@ -441,7 +441,7 @@ const ServicePage = () => {
text: value.label, text: value.label,
value: key, value: key,
})), })),
onFilter: (value, record) => record.attributes.type === value, onFilter: (value, record) => record.attributes.template_type === value,
render: (type) => { render: (type) => {
const typeConfig = TEMPLATE_TYPES[type]; const typeConfig = TEMPLATE_TYPES[type];
return typeConfig ? ( return typeConfig ? (
@@ -497,7 +497,7 @@ const ServicePage = () => {
type="link" type="link"
onClick={() => onClick={() =>
handleNavigateToTemplate( handleNavigateToTemplate(
record.attributes.type, record.attributes.template_type,
record.id, record.id,
"isView" "isView"
) )
@@ -509,7 +509,7 @@ const ServicePage = () => {
type="link" type="link"
onClick={() => onClick={() =>
handleNavigateToTemplate( handleNavigateToTemplate(
record.attributes.type, record.attributes.template_type,
record.id, record.id,
"edit" "edit"
) )