Skip to content

Commit

Permalink
feat: add models
Browse files Browse the repository at this point in the history
  • Loading branch information
moonbamijam committed Jan 22, 2024
1 parent 77f2f10 commit 370df38
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
26 changes: 26 additions & 0 deletions models/about.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import mongoose, { Schema } from "mongoose";

const aboutSchema = new Schema(
{
image: {
data: Buffer,
contentType: String
},
title: String,
desc: String,
name: String,
nickname: String,
age: Number,
birthday: String,
sex: String,
nationality: String,
status: String,
languages: String
}, {
timestamps: true,
}
);

const About = mongoose.models.About || mongoose.model("About", aboutSchema);

export default About;
19 changes: 19 additions & 0 deletions models/project.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import mongoose, { Schema } from "mongoose";

const projectSchema = new Schema(
{
image: {
data: Buffer,
contentType: String
},
title: String,
desc: String,
href: String,
}, {
timestamps: true,
}
);

const Project = mongoose.models.Project || mongoose.model("Project", projectSchema);

export default Project;

0 comments on commit 370df38

Please sign in to comment.