@obisey/nest 0.1.36 → 0.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -542,6 +542,9 @@ function BaseResolver(modelo) {
|
|
|
542
542
|
], borrarSSR)
|
|
543
543
|
.then(() => servicio.findByPk(IdModelo))
|
|
544
544
|
.then((item) => {
|
|
545
|
+
if (tipo === 'hasOne') {
|
|
546
|
+
return item.$set(alias, IdPlaneta);
|
|
547
|
+
}
|
|
545
548
|
return item.$add(alias, IdPlaneta, through ? { through } : null);
|
|
546
549
|
})
|
|
547
550
|
.then((response) => true)
|
|
@@ -570,7 +573,12 @@ function BaseResolver(modelo) {
|
|
|
570
573
|
...crearKey(planeta, IdPlaneta),
|
|
571
574
|
], borrarSSR)
|
|
572
575
|
.then(() => servicio.findByPk(IdModelo))
|
|
573
|
-
.then((item) =>
|
|
576
|
+
.then((item) => {
|
|
577
|
+
if (tipo === 'belongsTo' || tipo === 'hasOne') {
|
|
578
|
+
return item.$set(alias, null);
|
|
579
|
+
}
|
|
580
|
+
return item.$remove(alias, IdPlaneta);
|
|
581
|
+
})
|
|
574
582
|
.then(() => true)
|
|
575
583
|
.catch((err) => {
|
|
576
584
|
// log(chalk.red('desligar', alias, err, '***********'));
|