Skip to content

Commit

Permalink
refactor: update comment response type to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
skgndi12 committed Mar 6, 2024
1 parent 7ef4dee commit ce549a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions api/src/core/ports/comment.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export interface CreateCommentParams {
content: string;
}

export type FindManyAndCountResponse = {
export interface FindManyAndCountResponse {
comments: Comment[];
commentCount: number;
};
}

export interface FindCommentsParams {
// filter
Expand Down
16 changes: 8 additions & 8 deletions api/src/core/services/comment/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ export type SortBy = 'createdAt' | 'movieName';

export type Direction = 'asc' | 'desc';

export type CommentsPaginationResponse = {
export interface CommentsPaginationResponse {
sortBy: SortBy;
direction: Direction;
pageOffset: number;
pageSize: number;
totalEntryCount: number;
totalPageCount: number;
};
}

export type CreateCommentResponse = {
export interface CreateCommentResponse {
user: User;
comment: Comment;
};
}

export type GetCommentsResponse = {
export interface GetCommentsResponse {
users: User[];
comments: Comment[];
pagination: CommentsPaginationResponse;
};
}

export type UpdateCommentResponse = {
export interface UpdateCommentResponse {
user: User;
comment: Comment;
};
}

export interface CreateCommentDto {
requesterIdToken: AppIdToken;
Expand Down

0 comments on commit ce549a7

Please sign in to comment.