fix: change diameter to radius
All checks were successful
/ build-and-push-image (push) Successful in 1m25s
All checks were successful
/ build-and-push-image (push) Successful in 1m25s
This commit is contained in:
parent
b9fc8c84d3
commit
98f069c94e
|
@ -22,10 +22,10 @@ func KonuluKonumCreate(c *fiber.Ctx) error {
|
||||||
// Get form values
|
// Get form values
|
||||||
author := form.Value["author"][0]
|
author := form.Value["author"][0]
|
||||||
description := form.Value["description"][0]
|
description := form.Value["description"][0]
|
||||||
diameter := form.Value["geolocation-diameter"][0]
|
radius := form.Value["geolocation-radius"][0]
|
||||||
diameterInt, err := strconv.Atoi(diameter)
|
radiusInt, err := strconv.Atoi(radius)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
diameterInt = 50
|
radiusInt = 50
|
||||||
}
|
}
|
||||||
|
|
||||||
// Geolocation is stored as JSON array string
|
// Geolocation is stored as JSON array string
|
||||||
|
@ -67,7 +67,7 @@ func KonuluKonumCreate(c *fiber.Ctx) error {
|
||||||
|
|
||||||
// Write to DB
|
// Write to DB
|
||||||
db := DB.GetDB()
|
db := DB.GetDB()
|
||||||
db.Create(&models.KonuluKonum{URI: imageUri, ImageURL: imageURL, Coordinates: geolocation, AuthorName: author, Description: description, UnlockedCounter: 0, Diameter: diameterInt})
|
db.Create(&models.KonuluKonum{URI: imageUri, ImageURL: imageURL, Coordinates: geolocation, AuthorName: author, Description: description, UnlockedCounter: 0, Radius: radiusInt})
|
||||||
|
|
||||||
// Return URL
|
// Return URL
|
||||||
redirectURL := fmt.Sprintf("%s/x?id=%s", clientURL, imageUri)
|
redirectURL := fmt.Sprintf("%s/x?id=%s", clientURL, imageUri)
|
||||||
|
@ -97,7 +97,7 @@ func KonuluKonumGet(c *fiber.Ctx) error {
|
||||||
"loc": konuluKonum.Coordinates,
|
"loc": konuluKonum.Coordinates,
|
||||||
"author": konuluKonum.AuthorName,
|
"author": konuluKonum.AuthorName,
|
||||||
"description": konuluKonum.Description,
|
"description": konuluKonum.Description,
|
||||||
"diameter": konuluKonum.Diameter,
|
"radius": konuluKonum.Radius,
|
||||||
"unlocked_counter": konuluKonum.UnlockedCounter,
|
"unlocked_counter": konuluKonum.UnlockedCounter,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,6 @@ type KonuluKonum struct {
|
||||||
Coordinates string
|
Coordinates string
|
||||||
AuthorName string
|
AuthorName string
|
||||||
Description string
|
Description string
|
||||||
Diameter int
|
Radius int
|
||||||
UnlockedCounter int
|
UnlockedCounter int
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user