Rapport_React/src/modules/detailingcontestresponses.js

37 lines
1.5 KiB
JavaScript

const detailingcontestresponses = {
service: 'detailing',
module: 'contest_response',
title: 'Detailing Contest Responses',
subtitle: 'Detailing',
baseUrl: '/detailingcontestresponse',
listPath: '/detailingcontestresponses',
missingParentMessage: 'Contest not found',
parentParam: { urlKey: 'id', apiKey: 'con_id' },
parentField: { urlKey: 'id', field: 'con_id' },
skipEdit: true,
skipAdd: true,
listFields: [
{ key: 'actions', title: 'Actions', buttons: ['delete'] },
{ key: 'avatar', title: 'User Avatar', type: 'image' },
{ key: 'user_name', title: 'User Name', type: 'text' },
{ key: 'title', title: 'Media Name', type: 'text' },
{ key: 'media_type', title: 'Media Type', type: 'text' },
{ key: 'createdAt', title: 'Submitted On', type: 'date' },
{ key: 'marks', title: 'Avg. Marks', type: 'text' },
{ key: 'total', title: 'Avg. Total', type: 'text' },
{ key: 'result', title: 'Result', type: 'text' },
{ key: 'no_of_evaluations', title: 'No of Evaluations', type: 'text' },
{ key: 'likes_count', title: 'Likes', type: 'text' },
{ key: 'comments_count', title: 'Comments', type: 'text' },
],
listButtons: [{ title: 'Back to Detailing Contests', to: '/detailingcontests' }],
mapItems: (items) =>
items.map((item) => ({
...item,
user_name: item.user_name || item.user_info?.name || '',
avatar: item.avatar || item.user_info?.avatar || '',
})),
};
export default detailingcontestresponses;