Sync both clan lists.
This commit is contained in:
@@ -31,6 +31,21 @@ func GetAllClans(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, clans)
|
||||
}
|
||||
|
||||
// GetAllClanOptions GET /clan_options
|
||||
func GetAllClanOptions(c *gin.Context) {
|
||||
var clans []models.Clan
|
||||
models.DB.Find(&clans)
|
||||
|
||||
var htmlOptions string
|
||||
htmlOptions = `<option disabled selected value>Auswählen...</option>`
|
||||
for _, clan := range clans {
|
||||
htmlOptions += fmt.Sprintf(`<option value="%d">[%s] %s</option>`, clan.ID, clan.Tag, clan.Name)
|
||||
}
|
||||
|
||||
c.Header("Content-Type", "text/html")
|
||||
c.String(http.StatusOK, htmlOptions)
|
||||
}
|
||||
|
||||
// AddClan POST /clan
|
||||
func AddClan(c *gin.Context) {
|
||||
var input AddClanInput
|
||||
|
||||
Reference in New Issue
Block a user