This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user