fastapi-rocket-boilerplate
fastapi-rocket-boilerplate copied to clipboard
Admin: Fix popup for reverse_delete
Now the message for delete and reverse_delete is the same (delete message). It could be good to modify for reverse_delete being more accurate.
I had a look at this issue, the message shown during delete is hardcoded into the javascript code for sqladmin
.
Found here at sqladmin/statics/js/main.js.
Will have to look into the feasibility of overriding this js code.
@sajankp thanks for having a look mate, feel free to open a PR 🚀
The delete method do not pass information other than the model name
, id
used specific to the instance being deleted (sql admin implementation). Hence unable to access the "deleted" parameter within the js code.
The other way is to read it from the specific column using JS, but for any model that will not have the column deleted listed in the view will cause this feature to break, and this would be more of a hack than a good fix.
The ideal solution would be to have a separate action https://aminalaee.dev/sqladmin/configurations/#custom-action which does soft delete and have it's own template.
Leaving this message for future reference