fix: fileName formatting fixes

This commit is contained in:
Danny Avila 2023-04-06 16:18:36 -04:00
parent 4245b43140
commit 31cef16cc3
4 changed files with 103 additions and 5 deletions

View file

@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react';
import { useSetRecoilState, useRecoilValue } from 'recoil';
import filenamify from 'filenamify';
import axios from 'axios';
import exportFromJSON from 'export-from-json';
import DialogTemplate from '../ui/DialogTemplate';
@ -51,9 +52,10 @@ const EditPresetDialog = ({ open, onOpenChange, preset: _preset, title }) => {
};
const exportPreset = () => {
const fileName = filenamify(preset?.title || 'preset');
exportFromJSON({
data: cleanupPreset({ preset, endpointsFilter }),
fileName: `${preset?.title}.json`,
fileName,
exportType: exportFromJSON.types.json
});
};