Skip to content

Commit

Permalink
fix: correct types of firestore
Browse files Browse the repository at this point in the history
  • Loading branch information
thraizz committed Jan 26, 2024
1 parent 8bbcb40 commit 4545c95
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// User Type
export interface UserType {
export type User = {
userId: string;
username: string;
email: string;
password: string; // hashed
profilePicture?: string;
bio?: string;
}
};

// Project Type
export type Project = {
Expand All @@ -18,23 +18,23 @@ export type Project = {
images: string[]; // store links or references
textContent: string;
upvotesCount: number;
comments: CommentType[];
comments: Comment[];
createdAt: Date;
updatedAt?: Date;
};

// Comment Type
export interface CommentType {
export type Comment = {
commentId: string;
userId: string; // author's user ID
projectId: string; // associated project ID
textContent: string;
timestamp: Date;
}
};

// Database Collections
export interface DatabaseCollections {
users: Record<string, UserType>;
projects: Record<string, ProjectType>;
comments: Record<string, CommentType>;
users: Record<string, User>;
projects: Record<string, Project>;
comments: Record<string, Comment>;
}

0 comments on commit 4545c95

Please sign in to comment.