feat(template): add multiple page support to templates
build / Go-Build (push) Successful in 1m30s

This commit is contained in:
2026-05-27 22:02:11 +02:00
parent 2aab1bcdd2
commit ba2332ecb6
5 changed files with 76 additions and 36 deletions
+13
View File
@@ -3,6 +3,7 @@ package actions
import (
"bytes"
"fmt"
"io"
"log"
"regexp"
"strconv"
@@ -34,6 +35,18 @@ func AddPage(id string, svgbuf []byte) (svg.TemplatePage, error) {
return data, nil
}
func GetPage(id string, page int) ([]byte, error) {
file, err := svg.Storage.Get(fmt.Sprintf(FILEFORMAT, id, page))
if err != nil {
return nil, err
}
defer file.Close()
return io.ReadAll(file)
}
func DeletePage(id string, page int) (bool, error) {
if success, err := database.DeleteSVGPage(id, page); err != nil || !success {
return success, err