mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2025-01-04 03:49:23 +02:00
add "delete all mods" feature
This commit is contained in:
parent
2c447e242e
commit
36265c05ee
@ -20,6 +20,15 @@ const Mods = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const deleteAllMods = () => {
|
||||
modsResource.deleteAll()
|
||||
.then(res => {
|
||||
if(res.success) {
|
||||
fetchInstalledMods();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
server.factorioVersion()
|
||||
.then(res => {
|
||||
@ -55,7 +64,9 @@ const Mods = () => {
|
||||
</table>
|
||||
|
||||
}
|
||||
|
||||
actions={
|
||||
<Button size="sm" type="danger" onClick={deleteAllMods}>Delete all Mods</Button>
|
||||
}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
|
@ -42,8 +42,11 @@ const mods = {
|
||||
}
|
||||
})
|
||||
return response.data;
|
||||
},
|
||||
deleteAll: async () => {
|
||||
const response = await client.post('/api/mods/delete/all');
|
||||
return response.data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default mods;
|
Loading…
Reference in New Issue
Block a user