File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,20 @@ export interface Comment {
139139 created_at : Date ;
140140}
141141
142+ export interface CommentPresentation {
143+ id : string ;
144+ body ?: string ;
145+ level ?: number ;
146+ created_at ?: Date ;
147+ author ?: {
148+ id : string ;
149+ name : string ;
150+ username : string ;
151+ email : string ;
152+ } ;
153+ replies ?: CommentPresentation [ ] ;
154+ }
155+
142156export type REACTION_TYPE =
143157 | "LOVE"
144158 | "UNICORN"
Original file line number Diff line number Diff line change @@ -4,12 +4,13 @@ import { authID } from "./session.actions";
44import { ActionException } from "./RepositoryException" ;
55import { persistenceRepository } from "../persistence/persistence-repositories" ;
66import { eq } from "sqlkit" ;
7+ import { CommentPresentation } from "../models/domain-models" ;
78
89const sql = String . raw ;
910
1011export const getComments = async (
1112 _input : z . infer < typeof CommentActionInput . getComments >
12- ) => {
13+ ) : Promise < CommentPresentation [ ] > => {
1314 const input = CommentActionInput . getComments . parse ( _input ) ;
1415
1516 const query = sql `
You can’t perform that action at this time.
0 commit comments