add options , config
This commit is contained in:
@@ -35,7 +35,7 @@ func GetAllAlbums(c *context.Context) {
|
||||
|
||||
// GetAlbum -
|
||||
func GetAlbum(c *context.Context) {
|
||||
id := c.Param("id")
|
||||
id := c.Param("album")
|
||||
val, ok := c.Get("token")
|
||||
if !ok {
|
||||
c.CustomRes("Foridden", "user token data not found")
|
||||
@@ -99,7 +99,7 @@ func CreateAlbum(c *context.Context) {
|
||||
|
||||
// UpdateAlbum -
|
||||
func UpdateAlbum(c *context.Context) {
|
||||
id := c.Param("id")
|
||||
id := c.Param("album")
|
||||
postData := struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Public bool `json:"public" binding:"required"`
|
||||
@@ -146,7 +146,7 @@ func UpdateAlbum(c *context.Context) {
|
||||
|
||||
// DeleteAlbum -
|
||||
func DeleteAlbum(c *context.Context) {
|
||||
id := c.Param("id")
|
||||
id := c.Param("album")
|
||||
if len(id) == 0 {
|
||||
c.NotFound(nil)
|
||||
return
|
||||
|
||||
@@ -12,12 +12,14 @@ func GetAllAlbumPhotos(c *context.Context) {
|
||||
|
||||
// GetPhoto -
|
||||
func GetPhoto(c *context.Context) {
|
||||
album, ok := c.Get("album")
|
||||
data, ok := c.Get("album")
|
||||
album := data.(models.Album)
|
||||
if !ok {
|
||||
c.NotFound("album not found")
|
||||
return
|
||||
}
|
||||
_, err := models.GetPhoto(album.(map[string]interface{})["id"].(string))
|
||||
|
||||
_, err := models.GetPhoto(album.ID)
|
||||
if err != nil {
|
||||
c.ServerError(nil)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user