-
Notifications
You must be signed in to change notification settings - Fork 720
Export Collection Not Respecting Filters. #1650
Unanswered
yashRechargezap
asked this question in
Q&A
-
In my Admin Panel I want to export csv. It is working fine, But when I apply filter on the collection it is still exporting the complete collection.
here is the code how am I defining the ImportExport feature.
export const AdminOperatorsResource = {
resource: AdminOperators,
features: [importExportFeature({ componentLoader })],
options: {
navigation: Navigation.adminNavigation,
properties: {
accessToken: {
isVisible: {
edit: false,
show: false,
},
},
createdBy: {
isVisible: {
edit: false,
show: true,
new: false,
},
},
createdAt: {
isVisible: {
edit: false,
show: true,
new: false,
},
},
updatedBy: {
isVisible: {
edit: false,
show: true,
new: false,
},
},
updatedAt: {
isVisible: {
edit: false,
show: true,
new: false,
},
},
},
actions: {
new: {
before: async (request, context) => {
let count = (
await Counters.findOne({
_id: 'AdminOperators',
})
).sequence_value;
count = count + 1;
console.log(count);
const modifiedPayload = {
...request.payload,
_id: count,
createdBy: context.currentAdmin.id,
createdAt: new Date().toISOString(),
};
await Counters.findOneAndUpdate(
{
_id: 'AdminOperators',
},
{ sequence_value: count },
);
return {
...request,
payload: modifiedPayload,
};
},
},
edit: {
before: async (request, context) => {
const modifiedPayload = {
...request.payload,
updatedBy: context.currentAdmin.id,
updatedAt: new Date().toISOString(),
};
return {
...request,
payload: modifiedPayload,
};
},
},
BulkUpload: {
actionType: 'resource',
variant: 'success',
icon: 'File',
component: Components.BulkUpload,
handler: async (request, response, context) => {
const { record, currentAdmin } = context;
console.log(' Hi Dummy button was clicked!');
return {
record: await record.toJSON(currentAdmin),
msg: 'Hello world',
};
},
},
},
},
};```
Also How can I disable the Import button, as I only want the export feature.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment