Skip to content

Commit

Permalink
fix(plugin-core): array response in remove method of default presenter
Browse files Browse the repository at this point in the history
  • Loading branch information
guiseek committed Oct 4, 2021
1 parent 53fea40 commit d778d82
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions libs/plugin/core/src/generators/domain/generator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { normalizeOptions, addFiles, nxCleanCoreVersion, rxjsVersion } from '../../utils';
import { runTasksInSerial } from '@nrwl/workspace/src/utilities/run-tasks-in-serial';
import { normalizeOptions, addFiles, nxCleanCoreVersion } from '../../utils';
import { libraryGenerator } from '@nrwl/workspace/generators';
import { DomainGeneratorSchema } from '../../interfaces';
import {
Expand Down Expand Up @@ -41,8 +41,9 @@ export default async function (host: Tree, options: DomainGeneratorSchema) {
}

function updateDependencies(host: Tree) {
const corePackage = {
const packages = {
'@nx-clean/core': nxCleanCoreVersion,
'rxjs': rxjsVersion
};
return addDependenciesToPackageJson(host, corePackage, {});
return addDependenciesToPackageJson(host, packages, {});
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class <%= entity.className %>DefaultPresenter implements <%= entity.class

add<%= entity.className %>({ name }: Pick<<%= entity.className %>VM, 'name'>): Observable<<%= entity.className %>VM> {
const add$ = this.add<%= entity.className %>UC
.execute({ name, id: null })
.execute({ name, id: '' })
.pipe(map(this.mapper.mapFrom));

const <%= entity.propertyName %>s$ = this.getAll<%= entity.className %>sUC
Expand All @@ -90,7 +90,7 @@ export class <%= entity.className %>DefaultPresenter implements <%= entity.class
.execute()
.pipe(map((<%= entity.propertyName %>s) => <%= entity.propertyName %>s.map(this.mapper.mapFrom)));

forkJoin([remove$, <%= entity.propertyName %>s$]).subscribe(([<%= entity.propertyName %>s]) => {
forkJoin([remove$, <%= entity.propertyName %>s$]).subscribe(([,<%= entity.propertyName %>s]) => {
this.dispatch.next(
(this.state = {
...this.state,
Expand Down
3 changes: 2 additions & 1 deletion libs/plugin/core/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const nxCleanCoreVersion = '1.0.0';
export const nxCleanCoreVersion = '1.0.0';
export const rxjsVersion = '^7.3.1';

0 comments on commit d778d82

Please sign in to comment.