🐛 Bug fixes in check attachment

This commit is contained in:
2024-05-18 20:28:40 +08:00
parent 7d36755a72
commit 4b8bc3e09b
2 changed files with 2 additions and 4 deletions

View File

@ -94,7 +94,7 @@ func createPost(c *fiber.Ctx) error {
}
for _, attachment := range data.Attachments {
if services.CheckAttachmentByUUIDExists(attachment, "i.attachment") {
if !services.CheckAttachmentByUUIDExists(attachment, "i.attachment") {
return fiber.NewError(fiber.StatusBadRequest, fmt.Sprintf("attachment %s not found", attachment))
}
}
@ -170,7 +170,7 @@ func editPost(c *fiber.Ctx) error {
}
for _, attachment := range data.Attachments {
if services.CheckAttachmentByUUIDExists(attachment, "i.attachment") {
if !services.CheckAttachmentByUUIDExists(attachment, "i.attachment") {
return fiber.NewError(fiber.StatusBadRequest, fmt.Sprintf("attachment %s not found", attachment))
}
}