Skip to content

Commit

Permalink
chore(playground): 🤖 add onSuccess to mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
NetanelBasal committed Nov 25, 2023
1 parent eabe879 commit 46113b1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/app/mutation-page/mutation-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { TabComponent } from '../ui/query-tab/tab.component';
standalone: true,
imports: [CommonModule, FormsModule, TabsComponent, TabComponent],
templateUrl: './mutation-page.component.html',
styles: [],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class MutationPageComponent {
Expand All @@ -25,7 +24,14 @@ export class MutationPageComponent {
public newTodo = '';

public onAddTodo(title: string) {
this.addTodo.mutate({ title, showError: false });
this.addTodo.mutate(
{ title, showError: false },
{
onSuccess: () => {
console.log('onSuccess');
},
},
);
this.newTodo = '';
}

Expand Down

0 comments on commit 46113b1

Please sign in to comment.