Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Schematics): update upsert blueprint #1042

Merged
merged 1 commit into from
May 10, 2018

Conversation

timdeschryver
Copy link
Member

Closes #1039

Changed the payload of the upsert actions to have a fully qualified entity, see a0f45ff for the change.
I think this is the only change that needs to happen, if not I'll update accordingly.
This is the new (actions) output:

import { Update } from '@ngrx/entity';
import { Foo } from '../models/foo.model';

export enum FooActionTypes {
  LoadFoos = '[Foo] Load Foos',
  AddFoo = '[Foo] Add Foo',
  UpsertFoo = '[Foo] Upsert Foo',
  AddFoos = '[Foo] Add Foos',
  UpsertFoos = '[Foo] Upsert Foos',
  UpdateFoo = '[Foo] Update Foo',
  UpdateFoos = '[Foo] Update Foos',
  DeleteFoo = '[Foo] Delete Foo',
  DeleteFoos = '[Foo] Delete Foos',
  ClearFoos = '[Foo] Clear Foos'
}

export class LoadFoos implements Action {
  readonly type = FooActionTypes.LoadFoos;

  constructor(public payload: { foos: Foo[] }) {}
}

export class AddFoo implements Action {
  readonly type = FooActionTypes.AddFoo;

  constructor(public payload: { foo: Foo }) {}
}

export class UpsertFoo implements Action {
  readonly type = FooActionTypes.UpsertFoo;

  constructor(public payload: { foo: Foo }) {}
}

export class AddFoos implements Action {
  readonly type = FooActionTypes.AddFoos;

  constructor(public payload: { foos: Foo[] }) {}
}

export class UpsertFoos implements Action {
  readonly type = FooActionTypes.UpsertFoos;

  constructor(public payload: { foos: Foo[] }) {}
}

export class UpdateFoo implements Action {
  readonly type = FooActionTypes.UpdateFoo;

  constructor(public payload: { foo: Update<Foo> }) {}
}

export class UpdateFoos implements Action {
  readonly type = FooActionTypes.UpdateFoos;

  constructor(public payload: { foos: Update<Foo>[] }) {}
}

export class DeleteFoo implements Action {
  readonly type = FooActionTypes.DeleteFoo;

  constructor(public payload: { id: string }) {}
}

export class DeleteFoos implements Action {
  readonly type = FooActionTypes.DeleteFoos;

  constructor(public payload: { ids: string[] }) {}
}

export class ClearFoos implements Action {
  readonly type = FooActionTypes.ClearFoos;
}

export type FooActions =
 LoadFoos
 | AddFoo
 | UpsertFoo
 | AddFoos
 | UpsertFoos
 | UpdateFoo
 | UpdateFoos
 | DeleteFoo
 | DeleteFoos
 | ClearFoos;

@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.108% when pulling 505494a on tdeschryver:entity-upsert-schematics into c0893f1 on ngrx:master.

@brandonroberts brandonroberts merged commit 0d1d309 into ngrx:master May 10, 2018
@timdeschryver timdeschryver deleted the entity-upsert-schematics branch May 10, 2018 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants