-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add template endpoint #667
Conversation
c87e817
to
c80ae4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the minor suggestion, it looks good to me!
Also another nit is that in the first commit it is written that some columns were deprecated, but I don't see that in the code.
api/models/timelog.py
Outdated
customer_id = Column("customerid", Integer, ForeignKey("customer.id"), nullable=True) | ||
user_id = Column("usrid", Integer, ForeignKey("usr.id"), nullable=True) | ||
project_id = Column("projectid", Integer, ForeignKey("project.id"), nullable=True) | ||
is_global = Column(Boolean, nullable=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest adding default=False
, just to make sure no task is global by mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had started by removing the telework and onsite columns, but that was going to break some things
c80ae4f
to
f071988
Compare
- Add isGlobal column so that we can store global templates in db - Made usrid nullable since global templates won't belong to single user - Update model for table
- Add service to fetch all user templates plus global templates - Add schema
f071988
to
d7d223f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now, thank you!
First, there are some small changes to the
template
table to allow for storage of global templates in the database.Second, this adds a GET endpoint to the API to retriever user templates. This will get all templates the user has created as well as all global templates.