Skip to content

Conversation

@dkhalife
Copy link
Owner

@dkhalife 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

Copilot AI review requested due to automatic review settings February 9, 2025 19:28
@dkhalife dkhalife enabled auto-merge (squash) February 9, 2025 19:28
Copy link
Contributor

Copilot AI left a 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_provider switch 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 code and message to just error might 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 keeping Preload("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 keeping Preload("Labels") to ensure labels are populated.
query := r.db.WithContext(c).Where("tasks.created_by = ?", userID).Group("tasks.id").Order("next_due_date asc")

@dkhalife dkhalife merged commit 140522c into develop Feb 9, 2025
4 checks passed
@dkhalife dkhalife deleted the fixups branch February 9, 2025 19:29
dkhalife added a commit that referenced this pull request Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants