somewhere
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
function image(img) {
|
||||
if (img) return '/uploads/images/tickets/' + img
|
||||
}
|
||||
|
||||
const Ticket = mongoose.Schema({
|
||||
message: String,
|
||||
image: { type: String, get: image },
|
||||
isUser: { type: Boolean, default: true },
|
||||
read: { type: Boolean, default: false },
|
||||
user_id: { type: mongoose.ObjectId, ref: 'User' }
|
||||
})
|
||||
|
||||
const TicketConversation = mongoose.Schema({
|
||||
title: String,
|
||||
transaction_id: String,
|
||||
user_id: { type: mongoose.ObjectId, ref: 'User' },
|
||||
messages: [Ticket]
|
||||
})
|
||||
|
||||
module.exports = mongoose.model('TicketConversation', TicketConversation)
|
||||
Reference in New Issue
Block a user