diff --git a/app/pages/dashboard-contents/index.tsx b/app/pages/dashboard-contents/index.tsx index 6815f60..5bc737f 100644 --- a/app/pages/dashboard-contents/index.tsx +++ b/app/pages/dashboard-contents/index.tsx @@ -18,14 +18,19 @@ export const ContentsPage = () => { DataTable.use(DT) const dataTable = newsData const dataColumns = [ - { title: 'No', data: 'id' }, + { + title: 'No', + data: undefined, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + render: function (data: any, type: any, row: any, meta: any) { + return meta.row + 1 + }, + }, { title: 'Tanggal Konten', data: 'live_at' }, { title: 'Nama Penulis', - //ignore the error below - // eslint-disable-next-line @typescript-eslint/no-explicit-any - render: (data: any, type: any, row: any) => - `${row.author.name}
ID: ${row.id.slice(0, 12)}`, + + data: 'author', }, { title: 'Judul', data: 'title' }, { title: 'Kategori', data: 'categories' }, @@ -47,7 +52,9 @@ export const ContentsPage = () => { 1: (value: string) => { return formatDate(value) }, - // 2: (value: TAuthor) => `${value}`, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + 2: (value: any, type: any, data: any) => + `${value.name}
ID: ${data.id.slice(0, 12)}`, 4: (value: TCategories) => { const categories = value.map((item) => item.name).join(', ') return `${categories}`