mirror of
https://github.com/amitshekhariitbhu/go-backend-clean-architecture.git
synced 2026-04-27 05:25:51 +03:00
[GH-ISSUE #8] Declouple Controller from MongoDB #6
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-backend-clean-architecture#6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @marcosvidolin on GitHub (Jan 19, 2023).
Original GitHub issue: https://github.com/amitshekhariitbhu/go-backend-clean-architecture/issues/8
Hi,
We have a MongoDB dependency in the controller. You can see here: https://github.com/amitshekhariitbhu/go-backend-clean-architecture/blob/main/api/controller/task_controller.go#L8
Maybe we should consider move the code bellow to other layer:
What's your thoughts?
@amitshekhariitbhu commented on GitHub (Jan 19, 2023):
Hi @marcosvidolin
Your point is valid. A few more developers also suggested making this change. I shall do it.
Thanks
@ZeusMode commented on GitHub (Aug 24, 2023):
Hi @marcosvidolin
I understood your suggestion but makes me wonder how can we properly handle errors like this to not be generic InternalServerError?
Sorry for the late response here, I just found this project
@marcosvidolin commented on GitHub (Aug 29, 2023):
I would recommend moving this code to the MongoDB repository and also suggest creating a custom error in the following manner: