Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change entity linking so it isn't dependent on the data model. #71

Open
mcbloch opened this issue Jul 31, 2020 · 0 comments
Open

Change entity linking so it isn't dependent on the data model. #71

mcbloch opened this issue Jul 31, 2020 · 0 comments
Labels

Comments

@mcbloch
Copy link
Member

mcbloch commented Jul 31, 2020

We have multiple layers in the code

model (database and its tables and querries)
|
\/
controller (transforms the db object to the correct model)
|
\/
view (puts the nice model in a valid json response).

Our model has one tag table and most entities (like issues and branches) have their main id in there. This means that a link can be establisht with one endpoint ex. /project/:project-id/link/:object-to-link-id, and that there are no collisions.
The bad thing is that the view layer is now dependent on that property of the model layer. Which breaks the concept of seperated layers. Changing the model could mean changing the view, the api and in result the frontend.

Better would be to indicate the type of link in the body of the request:
POST /project/20/link body: {"repositories": [145, 146], "issues": [302]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant