-
Notifications
You must be signed in to change notification settings - Fork 0
Fixups in backend #44
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
Conversation
dkhalife
commented
Feb 9, 2025
- update login and authorization logic
- tokens api
- customize refresh token response
- labels api
- notification targets
- tasks create and read
- task api
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.
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Files not reviewed (1)
- internal/repos/label/label.go: Evaluated as low risk
Comments suppressed due to low confidence (10)
internal/api/label/label.go:175
- Ensure that the new behavior for the deleteLabel function, which now returns an empty JSON object, is covered by tests.
c.JSON(200, gin.H{})
internal/api/task/task.go:33
- The FrequencyMetadata field in the TaskReq struct has been commented out. This might cause issues if this field is expected in the request payload.
// FrequencyMetadata *tModel.FrequencyMetadata `json:"frequencyMetadata"`
internal/api/task/task.go:35
- The NotificationMetadata field in the TaskReq struct has been commented out. This might cause issues if this field is expected in the request payload.
// NotificationMetadata *tModel.NotificationMetadata `json:"notificationMetadata"`
internal/api/task/task.go:312
- The line r.db.WithContext(c).Where("task_id = ?", id) is incomplete and doesn't perform any action. It should be removed or completed.
r.db.WithContext(c).Where("task_id = ?", id)
internal/api/user/user.go:274
- The 'Target' field was removed from the 'Request' struct. If 'Target' is still required elsewhere in the code, this change could break existing functionality.
Type nModel.NotificationType `json:"type" binding:"required"`
internal/api/user/user.go:275
- [nitpick] The error message 'Invalid request' is too generic. It would be more helpful if it specified what exactly is invalid.
if err := c.ShouldBindJSON(&req); err != nil {
internal/middleware/auth/auth.go:57
- The removal of the
auth_providerswitch case might cause issues if the system supports multiple authentication providers. Ensure that this change is intentional and that all authentication providers are correctly handled.
Authenticator: func(c *gin.Context) (interface{}, error) {
internal/middleware/auth/auth.go:91
- Changing the unauthorized response from
codeandmessageto justerrormight cause inconsistencies in error handling. Ensure that this change aligns with the rest of the system's error handling conventions.
c.JSON(code, gin.H{ "error": message, })
internal/repos/task/task.go:35
- Removing
Preload("Labels")can cause unexpected behavior if the labels are expected to be loaded with the task. Consider keepingPreload("Labels")to ensure labels are populated.
if err := r.db.Debug().WithContext(c).Model(&tModel.Task{}).First(&task, taskID).Error; err != nil {
internal/repos/task/task.go:43
- Removing
Preload("Labels")can cause unexpected behavior if the labels are expected to be loaded with the tasks. Consider keepingPreload("Labels")to ensure labels are populated.
query := r.db.WithContext(c).Where("tasks.created_by = ?", userID).Group("tasks.id").Order("next_due_date asc")