Migrated read APIs to Nitro
This commit is contained in:
1 parent
eb4e9f0700
commit
ee5809a489
26 files changed
+558
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import mongoose, { Schema, type Model } from "mongoose"
|
||||
|
||||
const albumSchema = new Schema({
|
||||
name: { type: String, required: true },
|
||||
artists: {
|
||||
type: [{ type: Schema.Types.ObjectId, ref: "Artist" }],
|
||||
required: true,
|
||||
},
|
||||
file: { type: String, required: true },
|
||||
genre: { type: Schema.Types.ObjectId, ref: "Genre", required: true },
|
||||
})
|
||||
|
||||
export const Album =
|
||||
(mongoose.models.Album as Model<any> | undefined) ??
|
||||
(mongoose.model<any>("Album", albumSchema) as Model<any>)
|
||||
Reference in new issue
Block a user