@ -142,6 +142,8 @@ func UpdateNote(c *fiber.Ctx) error {
// Update
db.Model(¬e).Updates(noteRequest)
key := "note+" + id
redisclient.Remove(key)
return c.Status(fiber.StatusCreated).JSON(fiber.Map{
"status": constants.STATUS_OK,
@ -170,6 +172,8 @@ func DeleteNote(c *fiber.Ctx) error {
}
db.Delete(¬e)
return c.SendStatus(fiber.StatusNoContent)
@ -62,3 +62,9 @@ func Set(key string, model interface{}, expired time.Duration) error {
return nil
func Remove(key string) error {
redis := GetInstance()
fmt.Println("[REDIS][REMOVE] : ", key)
return redis.Do(ctx, "DEL", key).Err()