🐛 Not supposed to appear to status at the same time

This commit is contained in:
2024-06-27 00:37:50 +08:00
parent 0bce0d45c8
commit 3f0d3fc69e
2 changed files with 9 additions and 3 deletions

View File

@ -73,6 +73,12 @@ func setStatus(c *fiber.Ctx) error {
return err
}
// End the status already exists
if status, err := services.GetStatus(user.ID); err == nil {
status.ClearAt = lo.ToPtr(time.Now())
database.C.Save(&status)
}
status := models.Status{
Type: req.Type,
Label: req.Label,