Push updates: Add event types for photos & albums

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer
2020-01-30 18:19:26 +01:00
parent 11c3ed70e3
commit ceb7d258fe
11 changed files with 187 additions and 44 deletions

View File

@@ -48,6 +48,10 @@ func BatchPhotosArchive(router *gin.RouterGroup, conf *config.Config) {
event.Publish("config.updated", event.Data(conf.ClientConfig()))
event.Publish("photos.archived", event.Data{
"entities": f.Photos,
})
c.JSON(http.StatusOK, gin.H{"message": fmt.Sprintf("photos archived in %d s", elapsed)})
})
}
@@ -86,6 +90,10 @@ func BatchPhotosRestore(router *gin.RouterGroup, conf *config.Config) {
event.Publish("config.updated", event.Data(conf.ClientConfig()))
event.Publish("photos.restored", event.Data{
"entities": f.Photos,
})
c.JSON(http.StatusOK, gin.H{"message": fmt.Sprintf("photos restored in %d s", elapsed)})
})
}
@@ -120,6 +128,10 @@ func BatchAlbumsDelete(router *gin.RouterGroup, conf *config.Config) {
event.Publish("config.updated", event.Data(conf.ClientConfig()))
event.Publish("albums.deleted", event.Data{
"entities": f.Albums,
})
c.JSON(http.StatusOK, gin.H{"message": fmt.Sprintf("albums deleted")})
})
}