UPDATE: change submit
All checks were successful
Build and Release / release (push) Successful in 1m35s
All checks were successful
Build and Release / release (push) Successful in 1m35s
This commit is contained in:
@@ -6,6 +6,8 @@ INSERT INTO submissions (
|
|||||||
)
|
)
|
||||||
RETURNING
|
RETURNING
|
||||||
id, project_id, commit_id, user_id, created_at, status, reviewed_by, reviewed_at, review_note, content, is_deleted,
|
id, project_id, commit_id, user_id, created_at, status, reviewed_by, reviewed_at, review_note, content, is_deleted,
|
||||||
|
(SELECT title FROM projects WHERE id = submissions.project_id) AS project_title,
|
||||||
|
(SELECT description FROM projects WHERE id = submissions.project_id) AS project_description,
|
||||||
(
|
(
|
||||||
SELECT json_build_object(
|
SELECT json_build_object(
|
||||||
'id', u.id,
|
'id', u.id,
|
||||||
@@ -34,6 +36,7 @@ RETURNING
|
|||||||
-- name: GetSubmissionById :one
|
-- name: GetSubmissionById :one
|
||||||
SELECT
|
SELECT
|
||||||
s.id, s.project_id, s.commit_id, s.user_id, s.created_at, s.status, s.reviewed_by, s.reviewed_at, s.review_note, s.content, s.is_deleted,
|
s.id, s.project_id, s.commit_id, s.user_id, s.created_at, s.status, s.reviewed_by, s.reviewed_at, s.review_note, s.content, s.is_deleted,
|
||||||
|
p.title AS project_title, p.description AS project_description,
|
||||||
json_build_object(
|
json_build_object(
|
||||||
'id', u.id,
|
'id', u.id,
|
||||||
'email', u.email,
|
'email', u.email,
|
||||||
@@ -51,6 +54,7 @@ SELECT
|
|||||||
)::json
|
)::json
|
||||||
ELSE NULL::json END AS reviewer
|
ELSE NULL::json END AS reviewer
|
||||||
FROM submissions s
|
FROM submissions s
|
||||||
|
JOIN projects p ON s.project_id = p.id
|
||||||
JOIN users u ON s.user_id = u.id
|
JOIN users u ON s.user_id = u.id
|
||||||
LEFT JOIN user_profiles up ON u.id = up.user_id
|
LEFT JOIN user_profiles up ON u.id = up.user_id
|
||||||
LEFT JOIN users ru ON s.reviewed_by = ru.id
|
LEFT JOIN users ru ON s.reviewed_by = ru.id
|
||||||
@@ -64,14 +68,16 @@ SET
|
|||||||
reviewed_by = COALESCE(sqlc.narg('reviewed_by'), reviewed_by),
|
reviewed_by = COALESCE(sqlc.narg('reviewed_by'), reviewed_by),
|
||||||
review_note = COALESCE(sqlc.narg('review_note'), review_note),
|
review_note = COALESCE(sqlc.narg('review_note'), review_note),
|
||||||
content = COALESCE(sqlc.narg('content'), content)
|
content = COALESCE(sqlc.narg('content'), content)
|
||||||
FROM users u
|
FROM projects p, users u
|
||||||
LEFT JOIN user_profiles up ON u.id = up.user_id
|
LEFT JOIN user_profiles up ON u.id = up.user_id
|
||||||
LEFT JOIN users ru ON submissions.reviewed_by = ru.id
|
LEFT JOIN users ru ON submissions.reviewed_by = ru.id
|
||||||
LEFT JOIN user_profiles rup ON ru.id = rup.user_id
|
LEFT JOIN user_profiles rup ON ru.id = rup.user_id
|
||||||
WHERE submissions.id = sqlc.arg('id')
|
WHERE submissions.id = sqlc.arg('id')
|
||||||
|
AND submissions.project_id = p.id
|
||||||
AND submissions.user_id = u.id
|
AND submissions.user_id = u.id
|
||||||
RETURNING
|
RETURNING
|
||||||
submissions.id, submissions.project_id, submissions.commit_id, submissions.user_id, submissions.created_at, submissions.status, submissions.reviewed_by, submissions.reviewed_at, submissions.review_note, submissions.content, submissions.is_deleted,
|
submissions.id, submissions.project_id, submissions.commit_id, submissions.user_id, submissions.created_at, submissions.status, submissions.reviewed_by, submissions.reviewed_at, submissions.review_note, submissions.content, submissions.is_deleted,
|
||||||
|
p.title AS project_title, p.description AS project_description,
|
||||||
json_build_object(
|
json_build_object(
|
||||||
'id', u.id,
|
'id', u.id,
|
||||||
'email', u.email,
|
'email', u.email,
|
||||||
@@ -97,6 +103,7 @@ WHERE id = $1;
|
|||||||
-- name: SearchSubmissions :many
|
-- name: SearchSubmissions :many
|
||||||
SELECT
|
SELECT
|
||||||
s.id, s.project_id, s.commit_id, s.user_id, s.created_at, s.status, s.reviewed_by, s.reviewed_at, s.review_note, s.content, s.is_deleted,
|
s.id, s.project_id, s.commit_id, s.user_id, s.created_at, s.status, s.reviewed_by, s.reviewed_at, s.review_note, s.content, s.is_deleted,
|
||||||
|
p.title AS project_title, p.description AS project_description,
|
||||||
json_build_object(
|
json_build_object(
|
||||||
'id', u.id,
|
'id', u.id,
|
||||||
'email', u.email,
|
'email', u.email,
|
||||||
@@ -114,6 +121,7 @@ SELECT
|
|||||||
)::json
|
)::json
|
||||||
ELSE NULL::json END AS reviewer
|
ELSE NULL::json END AS reviewer
|
||||||
FROM submissions s
|
FROM submissions s
|
||||||
|
JOIN projects p ON s.project_id = p.id
|
||||||
JOIN users u ON s.user_id = u.id
|
JOIN users u ON s.user_id = u.id
|
||||||
LEFT JOIN user_profiles up ON u.id = up.user_id
|
LEFT JOIN user_profiles up ON u.id = up.user_id
|
||||||
LEFT JOIN users ru ON s.reviewed_by = ru.id
|
LEFT JOIN users ru ON s.reviewed_by = ru.id
|
||||||
@@ -168,6 +176,7 @@ WHERE s.is_deleted = false
|
|||||||
-- name: GetSubmissionsByIDs :many
|
-- name: GetSubmissionsByIDs :many
|
||||||
SELECT
|
SELECT
|
||||||
s.id, s.project_id, s.commit_id, s.user_id, s.created_at, s.status, s.reviewed_by, s.reviewed_at, s.review_note, s.content, s.is_deleted,
|
s.id, s.project_id, s.commit_id, s.user_id, s.created_at, s.status, s.reviewed_by, s.reviewed_at, s.review_note, s.content, s.is_deleted,
|
||||||
|
p.title AS project_title, p.description AS project_description,
|
||||||
json_build_object(
|
json_build_object(
|
||||||
'id', u.id,
|
'id', u.id,
|
||||||
'email', u.email,
|
'email', u.email,
|
||||||
@@ -185,8 +194,10 @@ SELECT
|
|||||||
)::json
|
)::json
|
||||||
ELSE NULL::json END AS reviewer
|
ELSE NULL::json END AS reviewer
|
||||||
FROM submissions s
|
FROM submissions s
|
||||||
|
JOIN projects p ON s.project_id = p.id
|
||||||
JOIN users u ON s.user_id = u.id
|
JOIN users u ON s.user_id = u.id
|
||||||
LEFT JOIN user_profiles up ON u.id = up.user_id
|
LEFT JOIN user_profiles up ON u.id = up.user_id
|
||||||
LEFT JOIN users ru ON s.reviewed_by = ru.id
|
LEFT JOIN users ru ON s.reviewed_by = ru.id
|
||||||
LEFT JOIN user_profiles rup ON ru.id = rup.user_id
|
LEFT JOIN user_profiles rup ON ru.id = rup.user_id
|
||||||
WHERE s.id = ANY($1::uuid[]) AND s.is_deleted = false;
|
WHERE s.id = ANY($1::uuid[]) AND s.is_deleted = false;
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ type SubmissionResponse struct {
|
|||||||
ReviewedAt *time.Time `json:"reviewed_at,omitempty"`
|
ReviewedAt *time.Time `json:"reviewed_at,omitempty"`
|
||||||
ReviewNote *string `json:"review_note,omitempty"`
|
ReviewNote *string `json:"review_note,omitempty"`
|
||||||
Content *string `json:"content,omitempty"`
|
Content *string `json:"content,omitempty"`
|
||||||
|
ProjectTitle string `json:"project_title"`
|
||||||
|
ProjectDescription *string `json:"project_description,omitempty"`
|
||||||
User *UserSimpleResponse `json:"user"`
|
User *UserSimpleResponse `json:"user"`
|
||||||
Reviewer *UserSimpleResponse `json:"reviewer,omitempty"`
|
Reviewer *UserSimpleResponse `json:"reviewer,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ INSERT INTO submissions (
|
|||||||
)
|
)
|
||||||
RETURNING
|
RETURNING
|
||||||
id, project_id, commit_id, user_id, created_at, status, reviewed_by, reviewed_at, review_note, content, is_deleted,
|
id, project_id, commit_id, user_id, created_at, status, reviewed_by, reviewed_at, review_note, content, is_deleted,
|
||||||
|
(SELECT title FROM projects WHERE id = submissions.project_id) AS project_title,
|
||||||
|
(SELECT description FROM projects WHERE id = submissions.project_id) AS project_description,
|
||||||
(
|
(
|
||||||
SELECT json_build_object(
|
SELECT json_build_object(
|
||||||
'id', u.id,
|
'id', u.id,
|
||||||
@@ -111,6 +113,8 @@ type CreateSubmissionRow struct {
|
|||||||
ReviewNote pgtype.Text `json:"review_note"`
|
ReviewNote pgtype.Text `json:"review_note"`
|
||||||
Content pgtype.Text `json:"content"`
|
Content pgtype.Text `json:"content"`
|
||||||
IsDeleted bool `json:"is_deleted"`
|
IsDeleted bool `json:"is_deleted"`
|
||||||
|
ProjectTitle string `json:"project_title"`
|
||||||
|
ProjectDescription pgtype.Text `json:"project_description"`
|
||||||
User []byte `json:"user"`
|
User []byte `json:"user"`
|
||||||
Reviewer []byte `json:"reviewer"`
|
Reviewer []byte `json:"reviewer"`
|
||||||
}
|
}
|
||||||
@@ -136,6 +140,8 @@ func (q *Queries) CreateSubmission(ctx context.Context, arg CreateSubmissionPara
|
|||||||
&i.ReviewNote,
|
&i.ReviewNote,
|
||||||
&i.Content,
|
&i.Content,
|
||||||
&i.IsDeleted,
|
&i.IsDeleted,
|
||||||
|
&i.ProjectTitle,
|
||||||
|
&i.ProjectDescription,
|
||||||
&i.User,
|
&i.User,
|
||||||
&i.Reviewer,
|
&i.Reviewer,
|
||||||
)
|
)
|
||||||
@@ -156,6 +162,7 @@ func (q *Queries) DeleteSubmission(ctx context.Context, id pgtype.UUID) error {
|
|||||||
const getSubmissionById = `-- name: GetSubmissionById :one
|
const getSubmissionById = `-- name: GetSubmissionById :one
|
||||||
SELECT
|
SELECT
|
||||||
s.id, s.project_id, s.commit_id, s.user_id, s.created_at, s.status, s.reviewed_by, s.reviewed_at, s.review_note, s.content, s.is_deleted,
|
s.id, s.project_id, s.commit_id, s.user_id, s.created_at, s.status, s.reviewed_by, s.reviewed_at, s.review_note, s.content, s.is_deleted,
|
||||||
|
p.title AS project_title, p.description AS project_description,
|
||||||
json_build_object(
|
json_build_object(
|
||||||
'id', u.id,
|
'id', u.id,
|
||||||
'email', u.email,
|
'email', u.email,
|
||||||
@@ -173,6 +180,7 @@ SELECT
|
|||||||
)::json
|
)::json
|
||||||
ELSE NULL::json END AS reviewer
|
ELSE NULL::json END AS reviewer
|
||||||
FROM submissions s
|
FROM submissions s
|
||||||
|
JOIN projects p ON s.project_id = p.id
|
||||||
JOIN users u ON s.user_id = u.id
|
JOIN users u ON s.user_id = u.id
|
||||||
LEFT JOIN user_profiles up ON u.id = up.user_id
|
LEFT JOIN user_profiles up ON u.id = up.user_id
|
||||||
LEFT JOIN users ru ON s.reviewed_by = ru.id
|
LEFT JOIN users ru ON s.reviewed_by = ru.id
|
||||||
@@ -192,6 +200,8 @@ type GetSubmissionByIdRow struct {
|
|||||||
ReviewNote pgtype.Text `json:"review_note"`
|
ReviewNote pgtype.Text `json:"review_note"`
|
||||||
Content pgtype.Text `json:"content"`
|
Content pgtype.Text `json:"content"`
|
||||||
IsDeleted bool `json:"is_deleted"`
|
IsDeleted bool `json:"is_deleted"`
|
||||||
|
ProjectTitle string `json:"project_title"`
|
||||||
|
ProjectDescription pgtype.Text `json:"project_description"`
|
||||||
User []byte `json:"user"`
|
User []byte `json:"user"`
|
||||||
Reviewer []byte `json:"reviewer"`
|
Reviewer []byte `json:"reviewer"`
|
||||||
}
|
}
|
||||||
@@ -211,6 +221,8 @@ func (q *Queries) GetSubmissionById(ctx context.Context, id pgtype.UUID) (GetSub
|
|||||||
&i.ReviewNote,
|
&i.ReviewNote,
|
||||||
&i.Content,
|
&i.Content,
|
||||||
&i.IsDeleted,
|
&i.IsDeleted,
|
||||||
|
&i.ProjectTitle,
|
||||||
|
&i.ProjectDescription,
|
||||||
&i.User,
|
&i.User,
|
||||||
&i.Reviewer,
|
&i.Reviewer,
|
||||||
)
|
)
|
||||||
@@ -220,6 +232,7 @@ func (q *Queries) GetSubmissionById(ctx context.Context, id pgtype.UUID) (GetSub
|
|||||||
const getSubmissionsByIDs = `-- name: GetSubmissionsByIDs :many
|
const getSubmissionsByIDs = `-- name: GetSubmissionsByIDs :many
|
||||||
SELECT
|
SELECT
|
||||||
s.id, s.project_id, s.commit_id, s.user_id, s.created_at, s.status, s.reviewed_by, s.reviewed_at, s.review_note, s.content, s.is_deleted,
|
s.id, s.project_id, s.commit_id, s.user_id, s.created_at, s.status, s.reviewed_by, s.reviewed_at, s.review_note, s.content, s.is_deleted,
|
||||||
|
p.title AS project_title, p.description AS project_description,
|
||||||
json_build_object(
|
json_build_object(
|
||||||
'id', u.id,
|
'id', u.id,
|
||||||
'email', u.email,
|
'email', u.email,
|
||||||
@@ -237,6 +250,7 @@ SELECT
|
|||||||
)::json
|
)::json
|
||||||
ELSE NULL::json END AS reviewer
|
ELSE NULL::json END AS reviewer
|
||||||
FROM submissions s
|
FROM submissions s
|
||||||
|
JOIN projects p ON s.project_id = p.id
|
||||||
JOIN users u ON s.user_id = u.id
|
JOIN users u ON s.user_id = u.id
|
||||||
LEFT JOIN user_profiles up ON u.id = up.user_id
|
LEFT JOIN user_profiles up ON u.id = up.user_id
|
||||||
LEFT JOIN users ru ON s.reviewed_by = ru.id
|
LEFT JOIN users ru ON s.reviewed_by = ru.id
|
||||||
@@ -256,6 +270,8 @@ type GetSubmissionsByIDsRow struct {
|
|||||||
ReviewNote pgtype.Text `json:"review_note"`
|
ReviewNote pgtype.Text `json:"review_note"`
|
||||||
Content pgtype.Text `json:"content"`
|
Content pgtype.Text `json:"content"`
|
||||||
IsDeleted bool `json:"is_deleted"`
|
IsDeleted bool `json:"is_deleted"`
|
||||||
|
ProjectTitle string `json:"project_title"`
|
||||||
|
ProjectDescription pgtype.Text `json:"project_description"`
|
||||||
User []byte `json:"user"`
|
User []byte `json:"user"`
|
||||||
Reviewer []byte `json:"reviewer"`
|
Reviewer []byte `json:"reviewer"`
|
||||||
}
|
}
|
||||||
@@ -281,6 +297,8 @@ func (q *Queries) GetSubmissionsByIDs(ctx context.Context, dollar_1 []pgtype.UUI
|
|||||||
&i.ReviewNote,
|
&i.ReviewNote,
|
||||||
&i.Content,
|
&i.Content,
|
||||||
&i.IsDeleted,
|
&i.IsDeleted,
|
||||||
|
&i.ProjectTitle,
|
||||||
|
&i.ProjectDescription,
|
||||||
&i.User,
|
&i.User,
|
||||||
&i.Reviewer,
|
&i.Reviewer,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
@@ -297,6 +315,7 @@ func (q *Queries) GetSubmissionsByIDs(ctx context.Context, dollar_1 []pgtype.UUI
|
|||||||
const searchSubmissions = `-- name: SearchSubmissions :many
|
const searchSubmissions = `-- name: SearchSubmissions :many
|
||||||
SELECT
|
SELECT
|
||||||
s.id, s.project_id, s.commit_id, s.user_id, s.created_at, s.status, s.reviewed_by, s.reviewed_at, s.review_note, s.content, s.is_deleted,
|
s.id, s.project_id, s.commit_id, s.user_id, s.created_at, s.status, s.reviewed_by, s.reviewed_at, s.review_note, s.content, s.is_deleted,
|
||||||
|
p.title AS project_title, p.description AS project_description,
|
||||||
json_build_object(
|
json_build_object(
|
||||||
'id', u.id,
|
'id', u.id,
|
||||||
'email', u.email,
|
'email', u.email,
|
||||||
@@ -314,6 +333,7 @@ SELECT
|
|||||||
)::json
|
)::json
|
||||||
ELSE NULL::json END AS reviewer
|
ELSE NULL::json END AS reviewer
|
||||||
FROM submissions s
|
FROM submissions s
|
||||||
|
JOIN projects p ON s.project_id = p.id
|
||||||
JOIN users u ON s.user_id = u.id
|
JOIN users u ON s.user_id = u.id
|
||||||
LEFT JOIN user_profiles up ON u.id = up.user_id
|
LEFT JOIN user_profiles up ON u.id = up.user_id
|
||||||
LEFT JOIN users ru ON s.reviewed_by = ru.id
|
LEFT JOIN users ru ON s.reviewed_by = ru.id
|
||||||
@@ -372,6 +392,8 @@ type SearchSubmissionsRow struct {
|
|||||||
ReviewNote pgtype.Text `json:"review_note"`
|
ReviewNote pgtype.Text `json:"review_note"`
|
||||||
Content pgtype.Text `json:"content"`
|
Content pgtype.Text `json:"content"`
|
||||||
IsDeleted bool `json:"is_deleted"`
|
IsDeleted bool `json:"is_deleted"`
|
||||||
|
ProjectTitle string `json:"project_title"`
|
||||||
|
ProjectDescription pgtype.Text `json:"project_description"`
|
||||||
User []byte `json:"user"`
|
User []byte `json:"user"`
|
||||||
Reviewer []byte `json:"reviewer"`
|
Reviewer []byte `json:"reviewer"`
|
||||||
}
|
}
|
||||||
@@ -409,6 +431,8 @@ func (q *Queries) SearchSubmissions(ctx context.Context, arg SearchSubmissionsPa
|
|||||||
&i.ReviewNote,
|
&i.ReviewNote,
|
||||||
&i.Content,
|
&i.Content,
|
||||||
&i.IsDeleted,
|
&i.IsDeleted,
|
||||||
|
&i.ProjectTitle,
|
||||||
|
&i.ProjectDescription,
|
||||||
&i.User,
|
&i.User,
|
||||||
&i.Reviewer,
|
&i.Reviewer,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
@@ -429,14 +453,16 @@ SET
|
|||||||
reviewed_by = COALESCE($2, reviewed_by),
|
reviewed_by = COALESCE($2, reviewed_by),
|
||||||
review_note = COALESCE($3, review_note),
|
review_note = COALESCE($3, review_note),
|
||||||
content = COALESCE($4, content)
|
content = COALESCE($4, content)
|
||||||
FROM users u
|
FROM projects p, users u
|
||||||
LEFT JOIN user_profiles up ON u.id = up.user_id
|
LEFT JOIN user_profiles up ON u.id = up.user_id
|
||||||
LEFT JOIN users ru ON submissions.reviewed_by = ru.id
|
LEFT JOIN users ru ON submissions.reviewed_by = ru.id
|
||||||
LEFT JOIN user_profiles rup ON ru.id = rup.user_id
|
LEFT JOIN user_profiles rup ON ru.id = rup.user_id
|
||||||
WHERE submissions.id = $5
|
WHERE submissions.id = $5
|
||||||
|
AND submissions.project_id = p.id
|
||||||
AND submissions.user_id = u.id
|
AND submissions.user_id = u.id
|
||||||
RETURNING
|
RETURNING
|
||||||
submissions.id, submissions.project_id, submissions.commit_id, submissions.user_id, submissions.created_at, submissions.status, submissions.reviewed_by, submissions.reviewed_at, submissions.review_note, submissions.content, submissions.is_deleted,
|
submissions.id, submissions.project_id, submissions.commit_id, submissions.user_id, submissions.created_at, submissions.status, submissions.reviewed_by, submissions.reviewed_at, submissions.review_note, submissions.content, submissions.is_deleted,
|
||||||
|
p.title AS project_title, p.description AS project_description,
|
||||||
json_build_object(
|
json_build_object(
|
||||||
'id', u.id,
|
'id', u.id,
|
||||||
'email', u.email,
|
'email', u.email,
|
||||||
@@ -475,6 +501,8 @@ type UpdateSubmissionRow struct {
|
|||||||
ReviewNote pgtype.Text `json:"review_note"`
|
ReviewNote pgtype.Text `json:"review_note"`
|
||||||
Content pgtype.Text `json:"content"`
|
Content pgtype.Text `json:"content"`
|
||||||
IsDeleted bool `json:"is_deleted"`
|
IsDeleted bool `json:"is_deleted"`
|
||||||
|
ProjectTitle string `json:"project_title"`
|
||||||
|
ProjectDescription pgtype.Text `json:"project_description"`
|
||||||
User []byte `json:"user"`
|
User []byte `json:"user"`
|
||||||
Reviewer []byte `json:"reviewer"`
|
Reviewer []byte `json:"reviewer"`
|
||||||
}
|
}
|
||||||
@@ -500,6 +528,8 @@ func (q *Queries) UpdateSubmission(ctx context.Context, arg UpdateSubmissionPara
|
|||||||
&i.ReviewNote,
|
&i.ReviewNote,
|
||||||
&i.Content,
|
&i.Content,
|
||||||
&i.IsDeleted,
|
&i.IsDeleted,
|
||||||
|
&i.ProjectTitle,
|
||||||
|
&i.ProjectDescription,
|
||||||
&i.User,
|
&i.User,
|
||||||
&i.Reviewer,
|
&i.Reviewer,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ type SubmissionEntity struct {
|
|||||||
ReviewNote *string `json:"review_note"`
|
ReviewNote *string `json:"review_note"`
|
||||||
Content *string `json:"content"`
|
Content *string `json:"content"`
|
||||||
IsDeleted bool `json:"is_deleted"`
|
IsDeleted bool `json:"is_deleted"`
|
||||||
|
ProjectTitle string `json:"project_title"`
|
||||||
|
ProjectDescription *string `json:"project_description"`
|
||||||
User *UserSimpleEntity `json:"user"`
|
User *UserSimpleEntity `json:"user"`
|
||||||
Reviewer *UserSimpleEntity `json:"reviewer"`
|
Reviewer *UserSimpleEntity `json:"reviewer"`
|
||||||
}
|
}
|
||||||
@@ -55,6 +57,8 @@ func (s *SubmissionEntity) ToResponse() *response.SubmissionResponse {
|
|||||||
ReviewedAt: s.ReviewedAt,
|
ReviewedAt: s.ReviewedAt,
|
||||||
ReviewNote: s.ReviewNote,
|
ReviewNote: s.ReviewNote,
|
||||||
Content: s.Content,
|
Content: s.Content,
|
||||||
|
ProjectTitle: s.ProjectTitle,
|
||||||
|
ProjectDescription: s.ProjectDescription,
|
||||||
User: s.User.ToResponse(),
|
User: s.User.ToResponse(),
|
||||||
Reviewer: s.Reviewer.ToResponse(),
|
Reviewer: s.Reviewer.ToResponse(),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ func (r *submissionRepository) GetByID(ctx context.Context, id pgtype.UUID) (*mo
|
|||||||
ReviewNote: convert.TextToPtr(row.ReviewNote),
|
ReviewNote: convert.TextToPtr(row.ReviewNote),
|
||||||
Content: convert.TextToPtr(row.Content),
|
Content: convert.TextToPtr(row.Content),
|
||||||
IsDeleted: row.IsDeleted,
|
IsDeleted: row.IsDeleted,
|
||||||
|
ProjectTitle: row.ProjectTitle,
|
||||||
|
ProjectDescription: convert.TextToPtr(row.ProjectDescription),
|
||||||
}
|
}
|
||||||
_ = entity.ParseUser(row.User)
|
_ = entity.ParseUser(row.User)
|
||||||
_ = entity.ParseReviewer(row.Reviewer)
|
_ = entity.ParseReviewer(row.Reviewer)
|
||||||
@@ -124,6 +126,8 @@ func (r *submissionRepository) getByIDsWithFallback(ctx context.Context, ids []s
|
|||||||
ReviewNote: convert.TextToPtr(row.ReviewNote),
|
ReviewNote: convert.TextToPtr(row.ReviewNote),
|
||||||
Content: convert.TextToPtr(row.Content),
|
Content: convert.TextToPtr(row.Content),
|
||||||
IsDeleted: row.IsDeleted,
|
IsDeleted: row.IsDeleted,
|
||||||
|
ProjectTitle: row.ProjectTitle,
|
||||||
|
ProjectDescription: convert.TextToPtr(row.ProjectDescription),
|
||||||
}
|
}
|
||||||
_ = entity.ParseUser(row.User)
|
_ = entity.ParseUser(row.User)
|
||||||
_ = entity.ParseReviewer(row.Reviewer)
|
_ = entity.ParseReviewer(row.Reviewer)
|
||||||
@@ -194,6 +198,8 @@ func (r *submissionRepository) Search(ctx context.Context, params sqlc.SearchSub
|
|||||||
ReviewNote: convert.TextToPtr(row.ReviewNote),
|
ReviewNote: convert.TextToPtr(row.ReviewNote),
|
||||||
Content: convert.TextToPtr(row.Content),
|
Content: convert.TextToPtr(row.Content),
|
||||||
IsDeleted: row.IsDeleted,
|
IsDeleted: row.IsDeleted,
|
||||||
|
ProjectTitle: row.ProjectTitle,
|
||||||
|
ProjectDescription: convert.TextToPtr(row.ProjectDescription),
|
||||||
}
|
}
|
||||||
_ = entity.ParseUser(row.User)
|
_ = entity.ParseUser(row.User)
|
||||||
_ = entity.ParseReviewer(row.Reviewer)
|
_ = entity.ParseReviewer(row.Reviewer)
|
||||||
@@ -247,6 +253,8 @@ func (r *submissionRepository) Create(ctx context.Context, params sqlc.CreateSub
|
|||||||
ReviewNote: convert.TextToPtr(row.ReviewNote),
|
ReviewNote: convert.TextToPtr(row.ReviewNote),
|
||||||
Content: convert.TextToPtr(row.Content),
|
Content: convert.TextToPtr(row.Content),
|
||||||
IsDeleted: row.IsDeleted,
|
IsDeleted: row.IsDeleted,
|
||||||
|
ProjectTitle: row.ProjectTitle,
|
||||||
|
ProjectDescription: convert.TextToPtr(row.ProjectDescription),
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := submission.ParseUser(row.User); err != nil {
|
if err := submission.ParseUser(row.User); err != nil {
|
||||||
@@ -284,6 +292,8 @@ func (r *submissionRepository) Update(ctx context.Context, params sqlc.UpdateSub
|
|||||||
ReviewNote: convert.TextToPtr(row.ReviewNote),
|
ReviewNote: convert.TextToPtr(row.ReviewNote),
|
||||||
Content: convert.TextToPtr(row.Content),
|
Content: convert.TextToPtr(row.Content),
|
||||||
IsDeleted: row.IsDeleted,
|
IsDeleted: row.IsDeleted,
|
||||||
|
ProjectTitle: row.ProjectTitle,
|
||||||
|
ProjectDescription: convert.TextToPtr(row.ProjectDescription),
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := submission.ParseUser(row.User); err != nil {
|
if err := submission.ParseUser(row.User); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user