feat: update for ppd data files

This commit is contained in:
hanif salafi 2024-05-29 14:37:41 +07:00
parent d828aba813
commit 776cbd6921
2 changed files with 6 additions and 3 deletions

View File

@ -96,8 +96,11 @@ func (_i *ppidDataFilesService) Save(c *fiber.Ctx) (err error) {
types := strings.Split(typesString[0], ",") types := strings.Split(typesString[0], ",")
positionsString := form.Value["positions"] positionsString := form.Value["positions"]
positions := strings.Split(positionsString[0], ",") positions := strings.Split(positionsString[0], ",")
var urls []string
urlsString := form.Value["urls"] urlsString := form.Value["urls"]
urls := strings.Split(urlsString[0], ",") if urlsString != nil {
urls = strings.Split(urlsString[0], ",")
}
files := form.File["files"] files := form.File["files"]
fileCounter := 0 fileCounter := 0
@ -105,7 +108,7 @@ func (_i *ppidDataFilesService) Save(c *fiber.Ctx) (err error) {
_i.Log.Info().Str("timestamp", time.Now(). _i.Log.Info().Str("timestamp", time.Now().
Format(time.RFC3339)).Str("Service", "Save"). Format(time.RFC3339)).Str("Service", "Save").
Interface("form", types).Msg("") Interface("form", files).Msg("")
for index, fileType := range types { for index, fileType := range types {
position := &positions[index] position := &positions[index]

View File

@ -12,7 +12,7 @@ body-limit = 104857600 # "100 * 1024 * 1024"
[db.postgres] [db.postgres]
dsn = "postgresql://humas_polri:P@ssw0rd.1@103.82.242.92:5432/humas_polri" # <driver>://<username>:<password>@<host>:<port>/<database> dsn = "postgresql://humas_polri:P@ssw0rd.1@103.82.242.92:5432/humas_polri" # <driver>://<username>:<password>@<host>:<port>/<database>
migrate = true migrate = false
seed = false seed = false
[logger] [logger]