Skip to content

Commit

Permalink
fix(training): model extension mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
fpaul-1A committed Dec 5, 2024
1 parent f03d9be commit f6b90a4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
Revived flight:
<pre>{{flight() | json }}</pre>

@if (error()) {
Error:
{{ error() }}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@ export class AppComponent {

public readonly flight = signal<Flight | undefined>(undefined);

public readonly error = signal('');

constructor() {
void this.loadDummyData();
}

async loadDummyData() {
const dummyData = await this.dummyApi.dummyGet({});
this.flight.set(dummyData);
this.error.set('');
try {
const dummyData = await this.dummyApi.dummyGet({});
this.flight.set(dummyData);
} catch (err: any) {
this.error.set(err);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function dummyApiFactory(logger: Logger) {
adapter: new SequentialMockAdapter(
OPERATION_ADAPTER,
{
'/dummy_get': [{
'dummyGet': [{
mockData: {
originLocationCode: 'PAR',
destinationLocationCode: 'NYC'
Expand Down

0 comments on commit f6b90a4

Please sign in to comment.