Fix bug with gangs syntax error

This commit is contained in:
Senad Uka
2020-10-21 15:28:46 +02:00
parent 6f655dfe2b
commit 661845359e

View File

@@ -18,8 +18,8 @@ const GangDetails = (props) => {
try {
const response = await axios.get(`/api/gangs/${gang.id}/backup`);
const timestamp = Date.now();
const safeGangName = str.replace(/blue/g, "red");
fileDownload(response.data, `fil.csv`, 'text/csv')
const safeGangName = gangName.replace(/[^A-Za-z0-9]+/g, "");
fileDownload(response.data, `${safeGangName}-${timestamp}.csv`, 'text/csv')
} catch (e) {
console.log("EE ", e);
}