backend
    Preparing search index...
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Parameters

      • email: string

        The email address of the user whose profile is to be retrieved.

      Returns Promise<
          {
              comments: {
                  bookId: string;
                  createdAt: Date;
                  id: string;
                  text: string;
                  userId: string;
              }[];
              favoriteAuthors: (
                  {
                      author: {
                          approveStatus: boolean;
                          biggerProfilePic: string
                          | null;
                          biggerProfilePicKey: string | null;
                          bio: string | null;
                          birthDate: Date | null;
                          createdAt: Date;
                          id: string;
                          name: string;
                          nationality: string | null;
                          openLibraryId: string | null;
                          smallerProfilePic: string | null;
                          smallerProfilePicKey: string | null;
                          subjects: string | null;
                          topWorks: string | null;
                          updatedAt: Date;
                      };
                  } & { authorId: string; userId: string }
              )[];
              favoriteBooks: (
                  {
                      book: {
                          statistics: | {
                              averageRating: number;
                              bookId: string;
                              id: string;
                              ratingCount: number;
                              readersCount: number;
                              reviewCount: number;
                              wantToReadCount: number;
                          }
                          | null;
                      } & {
                          approveStatus: boolean;
                          authorId: string
                          | null;
                          biggerCoverPic: string;
                          biggerCoverPicKey: string | null;
                          createdAt: Date;
                          description: string;
                          googleBookId: string | null;
                          id: string;
                          latestPublicationYear: number | null;
                          openLibraryId: string | null;
                          originalPublicationYear: number | null;
                          originalPublisher: string | null;
                          pageNumber: number | null;
                          smallerCoverPic: string;
                          smallerCoverPicKey: string | null;
                          title: string;
                          updatedAt: Date;
                      };
                  } & { bookId: string; userId: string }
              )[];
              haveReadIt: (
                  {
                      book: {
                          statistics: | {
                              averageRating: number;
                              bookId: string;
                              id: string;
                              ratingCount: number;
                              readersCount: number;
                              reviewCount: number;
                              wantToReadCount: number;
                          }
                          | null;
                      } & {
                          approveStatus: boolean;
                          authorId: string
                          | null;
                          biggerCoverPic: string;
                          biggerCoverPicKey: string | null;
                          createdAt: Date;
                          description: string;
                          googleBookId: string | null;
                          id: string;
                          latestPublicationYear: number | null;
                          openLibraryId: string | null;
                          originalPublicationYear: number | null;
                          originalPublisher: string | null;
                          pageNumber: number | null;
                          smallerCoverPic: string;
                          smallerCoverPicKey: string | null;
                          title: string;
                          updatedAt: Date;
                      };
                  } & { addedAt: Date; bookId: string; id: string; userId: string }
              )[];
              ratings: {
                  bookId: string;
                  createdAt: Date;
                  score: number;
                  userId: string;
              }[];
          } & {
              biggerProfilePic: string
              | null;
              createdAt: Date;
              email: string;
              nickname: string | null;
              smallerProfilePic: string | null;
              updatedAt: Date;
          },
      >

      The user profile information, excluding sensitive fields such as id and S3 keys.

      Retrieves the user profile information based on the provided email address. If the user is not found, a NotFoundException is thrown.

      NotFoundException if no user with the specified email is found in the database.

    • Parameters

      • email: string

        The email address of the user whose profile is to be updated.

      • file: UploadedFile | null

        The uploaded file for the user's profile picture.

      • updateUserDto: UpdateUserDto

        The data for updating the user's profile.

      • isFirstTime: boolean

        A flag indicating whether this is the first time the user is updating their profile.

      Returns Promise<
          {
              biggerProfilePic: string
              | null;
              createdAt: Date;
              email: string;
              nickname: string | null;
              smallerProfilePic: string | null;
              updatedAt: Date;
          },
      >

      The updated user profile information, excluding sensitive fields such as id and S3 keys.

      Updates the profile information of the user with the specified email address. If the user is not found, a NotFoundException is thrown.

      NotFoundException if no user with the specified email is found in the database.

      BadRequestException if the nickname is required for first-time update but not provided.

      InternalServerErrorException if an unexpected error occurs while updating the user or uploading images.