Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/header 검색결과 조회, 최근검색어 조회 및 삭제 api 로직 구현 #16

Merged
merged 7 commits into from
Jul 1, 2024

Conversation

sen2y
Copy link
Collaborator

@sen2y sen2y commented Jun 30, 2024

userschema 변경 및 최근 검색, 검색결과 api 로직 구현 완료 + 테스트 완료

const userSchema = new mongoose.Schema(
    {
        deletedAt: { type: Date, default: null },
        nickname: { type: String, required: true, unique: true, maxlength: 10, match: /^[a-zA-Z0-9-]+$/ },
        email: {
            type: String,
            required: true,
            unique: true,
            maxlength: 50,
            match: /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/,
        },
        password: { type: String, minLength: 8, maxLength: 20 },
        role: { type: String, enum: ['user', 'ADMIN'], default: 'user' },
        snsId: { type: String, default: null },
        provider: { type: String, enum: ['kakao'], default: null },
        recentSearches: [
            {
                searchTerm: { type: String, required: true },
                updatedAt: { type: Date, default: Date.now },
                deletedAt: { type: Date, default: null },
            },
        ],
        requests: [requestSchema],
    },
    { timestamps: true }
);

image
image
image
image
image

@sen2y sen2y requested review from grulla99 and jjikky June 30, 2024 18:21
Copy link
Collaborator

@grulla99 grulla99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨어요 세니!

Copy link
Collaborator

@jjikky jjikky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고해써 세니~

@sen2y sen2y merged commit 7e565bf into Murakano:dev Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants