mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-20 09:20:11 +00:00
Code cleanup; Implement persistant storage; Use maps for storage
This commit is contained in:
@@ -65,14 +65,14 @@ func CreateDatabase(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
status := repositories.CreateDatabase(newDatabase)
|
||||
createdDatabase, status := repositories.CreateDatabase(newDatabase)
|
||||
if status == repositorymodels.Conflict {
|
||||
c.IndentedJSON(http.StatusConflict, gin.H{"message": "Conflict"})
|
||||
return
|
||||
}
|
||||
|
||||
if status == repositorymodels.StatusOk {
|
||||
c.IndentedJSON(http.StatusCreated, newDatabase)
|
||||
c.IndentedJSON(http.StatusCreated, createdDatabase)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user