FIX: Belonging Bugs
This commit is contained in:
@@ -10,10 +10,10 @@ const belongingSchema = new mongoose.Schema(
|
||||
required: true,
|
||||
unique: true,
|
||||
},
|
||||
belongingCode: {
|
||||
type: Number,
|
||||
unique: true,
|
||||
},
|
||||
// belongingCode: {
|
||||
// type: Number,
|
||||
// unique: true,
|
||||
// },
|
||||
category: {
|
||||
type: ObjectID,
|
||||
ref: 'Category',
|
||||
@@ -61,7 +61,7 @@ const belongingSchema = new mongoose.Schema(
|
||||
}
|
||||
)
|
||||
|
||||
belongingSchema.plugin(AutoIncrement, { inc_field: 'belongingCode' })
|
||||
// belongingSchema.plugin(AutoIncrement, { inc_field: 'belongingCode' })
|
||||
|
||||
belongingSchema.methods.getDocumentsSignedUrls = function () {
|
||||
return getMultipleSignedUrls(this.documentUrls, 'belonging-documents')
|
||||
|
||||
@@ -107,7 +107,7 @@ const indexAllBelongings = async () => {
|
||||
const data = {
|
||||
_id: belonging._id,
|
||||
isActive: belonging.isActive,
|
||||
belongingCode: belonging.belongingCode,
|
||||
// belongingCode: belonging.belongingCode,
|
||||
name: belonging.name,
|
||||
category: belonging.category.englishName,
|
||||
nativeCategory: belonging.category.nativeName,
|
||||
@@ -136,7 +136,7 @@ const getTypeSenseSchema = () => {
|
||||
fields: [
|
||||
{ name: '_id', type: 'string', facet: false, infix: false },
|
||||
{ name: 'name', type: 'string', facet: false, infix: true },
|
||||
{ name: 'belongingCode', type: 'int64', facet: false },
|
||||
// { name: 'belongingCode', type: 'int64', facet: false },
|
||||
{ name: 'category', type: 'string', facet: true, infix: true },
|
||||
{ name: 'nativeCategory', type: 'string', facet: false, infix: true },
|
||||
{ name: 'description', type: 'string', facet: false },
|
||||
|
||||
Reference in New Issue
Block a user