|
|
|
@@ -54,7 +54,7 @@ func (h *ListHandler) CreateList(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slog.InfoContext(ctx, "created list successfully", slog.Any("list_id", list.ID))
|
|
|
|
|
slog.InfoContext(ctx, "created list successfully", slog.String("list_id", list.ID))
|
|
|
|
|
response.JSON(ctx, w, http.StatusCreated, list)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -94,7 +94,7 @@ func (h *ListHandler) DeleteList(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slog.InfoContext(ctx, "deleted list successfully", slog.Any("list_id", listID))
|
|
|
|
|
slog.InfoContext(ctx, "deleted list successfully", slog.String("list_id", listID))
|
|
|
|
|
response.Status(w, http.StatusNoContent)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -174,7 +174,10 @@ func (h *ListHandler) AddUserToList(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slog.InfoContext(ctx, "added user to list successfully", slog.Any("list_id", payload.ListID), slog.Any("email", user.Email))
|
|
|
|
|
slog.InfoContext(ctx, "added user to list successfully",
|
|
|
|
|
slog.String("list_id", payload.ListID),
|
|
|
|
|
slog.String("email", user.Email),
|
|
|
|
|
)
|
|
|
|
|
response.Status(w, http.StatusNoContent)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -222,7 +225,10 @@ func (h *ListHandler) RemoveUserFromList(w http.ResponseWriter, r *http.Request)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slog.InfoContext(ctx, "removed user from list successfully", slog.Any("list_id", payload.ListID), slog.Any("email", user.Email))
|
|
|
|
|
slog.InfoContext(ctx, "removed user from list successfully",
|
|
|
|
|
slog.String("list_id", payload.ListID),
|
|
|
|
|
slog.String("email", user.Email),
|
|
|
|
|
)
|
|
|
|
|
response.Status(w, http.StatusNoContent)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -262,7 +268,7 @@ func (h *ListHandler) CreateListItem(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slog.InfoContext(ctx, "created list item successfully", slog.Any("list_item_id", item.ID))
|
|
|
|
|
slog.InfoContext(ctx, "created list item successfully", slog.String("list_item_id", item.ID))
|
|
|
|
|
response.JSON(ctx, w, http.StatusCreated, item)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -302,7 +308,7 @@ func (h *ListHandler) DeleteListItem(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slog.InfoContext(ctx, "deleted list item successfully", slog.Any("list_item_id", listItemID))
|
|
|
|
|
slog.InfoContext(ctx, "deleted list item successfully", slog.String("list_item_id", listItemID))
|
|
|
|
|
response.Status(w, http.StatusNoContent)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -343,7 +349,7 @@ func (h *ListHandler) UpdateListItem(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slog.InfoContext(ctx, "updated list item successfully", slog.Any("list_item_id", payload.ListItemID))
|
|
|
|
|
slog.InfoContext(ctx, "updated list item successfully", slog.String("list_item_id", payload.ListItemID))
|
|
|
|
|
response.Status(w, http.StatusNoContent)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -393,7 +399,7 @@ func (h *ListHandler) SetListItemCompleted(w http.ResponseWriter, r *http.Reques
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slog.InfoContext(ctx, "updated list item completed successful", slog.Any("list_item_id", listItemID))
|
|
|
|
|
slog.InfoContext(ctx, "updated list item completed successful", slog.String("list_item_id", listItemID))
|
|
|
|
|
response.Status(w, http.StatusNoContent)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|