- fix: Errore se premevo "Aggiungi" e poi "Annulla" poi la tabella non si aggiornava piu.
This commit is contained in:
@@ -30,6 +30,9 @@ const MyHospSchema = new Schema({
|
||||
visibile: {
|
||||
type: Boolean
|
||||
},
|
||||
adType: {
|
||||
type: Number,
|
||||
},
|
||||
typeHosp: { // scambio casa / ospitalità
|
||||
type: Number,
|
||||
},
|
||||
@@ -327,6 +330,19 @@ MyHospSchema.statics.getCompleteRecord = function (idapp, id) {
|
||||
|
||||
};
|
||||
|
||||
MyHospSchema.statics.SettaAdTypeOffro_In_Hosps = function () {
|
||||
const MyHosp = this;
|
||||
|
||||
// Set all records 'adType' to shared_consts.AdType.OFFRO
|
||||
MyHosp.updateMany({}, { $set: { adType: shared_consts.AdType.OFFRO } }, function (err, result) {
|
||||
if (err) {
|
||||
console.error('Error updating adType:', err);
|
||||
} else {
|
||||
console.log('Successfully updated adType for', result.nModified, 'records');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
MyHospSchema.statics.getProject = function () {
|
||||
let proj = {
|
||||
visibile: 1,
|
||||
|
||||
Reference in New Issue
Block a user