feat(svg): added svg template delete endpoint
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package actions
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"tomatentum.net/svg-templater/internal/database"
|
||||
"tomatentum.net/svg-templater/pkg/svg"
|
||||
)
|
||||
|
||||
func Delete(id string) (bool, error) {
|
||||
if success, err := database.DeleteSvg(id); err != nil || !success {
|
||||
return success, err
|
||||
}
|
||||
|
||||
if err := svg.Storage.Delete(id); err != nil {
|
||||
return false, err
|
||||
}
|
||||
log.Println("Deleted SVG Template " + id)
|
||||
return true, nil
|
||||
}
|
||||
Reference in New Issue
Block a user