Skip to content

Commit 82b653d

Browse files
committed
fix: enhance error handling for missing metadata in dataset summary and update validation checks
1 parent b44002a commit 82b653d

File tree

1 file changed

+9
-2
lines changed
  • app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/[id]/edit/publish

1 file changed

+9
-2
lines changed

app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/[id]/edit/publish/page.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,13 @@ const Page = () => {
210210
{
211211
name: 'Metadata',
212212
data: getDatasetsSummary.data?.datasets[0]?.metadata,
213-
error: '',
213+
error:
214+
getDatasetsSummary.data?.datasets[0]?.sectors.length === 0 ||
215+
getDatasetsSummary.data?.datasets[0]?.sectors.length === 0 ||
216+
getDatasetsSummary.data?.datasets[0]?.description.length === 0
217+
? 'Tags or Description or Sectors is missing. Please add to continue.'
218+
: '',
219+
errorType: 'critical',
214220
},
215221
];
216222

@@ -265,14 +271,15 @@ const Page = () => {
265271
process.env.NEXT_PUBLIC_ENABLE_ACCESSMODEL === 'true';
266272
const hasRequiredMetadata =
267273
dataset.sectors.length > 0 &&
268-
dataset.description.length > 10 &&
274+
dataset.description.length > 0 &&
269275
dataset.tags.length > 0;
270276

271277
// No resources
272278
if (!hasResources) return true;
273279

274280
// Access model check if enabled
275281
if (isAccessModelEnabled && !hasAccessModels) return true;
282+
console.log(hasRequiredMetadata);
276283

277284
// Required metadata check
278285
return !hasRequiredMetadata;

0 commit comments

Comments
 (0)