Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
previously, the DeleteUser function was not working as it chained `.Delete(&user)` after `.First(&user)`. this resulted in a query as shown, and its corresponding error: * `ERROR: table name "users" specified more than once (SQLSTATE 42712) [8.059ms] [rows:1] UPDATE "users" SET "deleted_at"='2024-02-12 20:52:41.02' FROM "users" WHERE id = 4 AND "users"."deleted_at" IS NULL AND "users"."id" = 4` the intent of `.First(&user)` was likely to store the user to be deleted first in the `user` variable with the use of a `SELECT` SQL statement. however, chaining another method at the end of a finisher method likely led to some errors (see chaining [here](https://gorm.io/docs/method_chaining.html)). thus, this commit attempts to separate the two statements, preserving the initial intent of storing the user to be deleted before deleting, and then returning this user.
- Loading branch information