generated from nhcarrigan/template
feat: add ability to like books
This commit is contained in:
@@ -13,4 +13,5 @@ export type * from "./lib/auth.types";
|
||||
export * from "./lib/comment.types";
|
||||
export * from "./lib/audit.types";
|
||||
export * from "./lib/suggestion.types";
|
||||
export * from "./lib/common.types";
|
||||
export * from "./lib/common.types";
|
||||
export * from "./lib/like.types";
|
||||
@@ -8,6 +8,8 @@ export enum AuditAction {
|
||||
ENTRY_CREATE = "ENTRY_CREATE",
|
||||
ENTRY_UPDATE = "ENTRY_UPDATE",
|
||||
ENTRY_DELETE = "ENTRY_DELETE",
|
||||
LIKE = "LIKE",
|
||||
UNLIKE = "UNLIKE",
|
||||
USER_BAN = "USER_BAN",
|
||||
USER_UNBAN = "USER_UNBAN",
|
||||
RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED",
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* @copyright 2026 NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
export interface Like {
|
||||
id: string;
|
||||
userId: string;
|
||||
entityType: 'book' | 'game' | 'show' | 'manga' | 'music' | 'art';
|
||||
entityId: string;
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
export type CreateLikeDto = Pick<Like, 'entityType' | 'entityId'>;
|
||||
|
||||
export interface LikeCountDto {
|
||||
entityId: string;
|
||||
entityType: string;
|
||||
count: number;
|
||||
}
|
||||
|
||||
export interface LikedItemDto {
|
||||
like: Like;
|
||||
item: any; // This will be the actual entity (Book, Game, etc.)
|
||||
}
|
||||
|
||||
// Response types
|
||||
export interface LikeResponse {
|
||||
liked: boolean;
|
||||
count: number;
|
||||
}
|
||||
Reference in New Issue
Block a user