From 96355bb914f1a997c2234b79bb4bc2fb4c59d2eb Mon Sep 17 00:00:00 2001 From: gearnode Date: Sun, 26 Jan 2025 14:02:25 +0100 Subject: [PATCH] Add task graphql encoding Signed-off-by: gearnode --- pkg/api/console/v1/types/task.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/api/console/v1/types/task.go b/pkg/api/console/v1/types/task.go index bcb66a84a..af7095fae 100644 --- a/pkg/api/console/v1/types/task.go +++ b/pkg/api/console/v1/types/task.go @@ -32,13 +32,17 @@ func NewTaskConnection(p *page.Page[*coredata.Task]) *TaskConnection { } } -func NewTaskEdge(f *coredata.Task) *TaskEdge { +func NewTaskEdge(t *coredata.Task) *TaskEdge { return &TaskEdge{ - Cursor: f.CursorKey(), - Node: NewTask(f), + Cursor: t.CursorKey(), + Node: NewTask(t), } } -func NewTask(e *coredata.Task) *Task { - return &Task{} +func NewTask(t *coredata.Task) *Task { + return &Task{ + ID: t.ID, + CreatedAt: t.CreatedAt, + UpdatedAt: t.UpdatedAt, + } }