Skip to content

Commit

Permalink
docs: Fix ui extension detail view examples
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Aug 22, 2023
1 parent 78be541 commit 738fe68
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Let's say you have a plugin which adds a new entity to the database called `Prod
The detail component itself is an Angular component which extends the [BaseDetailComponent]({{< relref "base-detail-component" >}}) or [TypedBaseDetailComponent]({{< relref "typed-base-detail-component" >}}) class.

```TypeScript
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { ChangeDetectionStrategy, Component, OnInit, OnDestroy } from '@angular/core';
import { FormBuilder } from '@angular/forms';
import { TypedBaseDetailComponent, LanguageCode } from '@vendure/admin-ui/core';
import { gql } from 'apollo-angular';
Expand Down Expand Up @@ -47,7 +47,7 @@ export const GET_REVIEW_DETAIL = gql`
styleUrls: ['./review-detail.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ReviewDetailComponent extends TypedBaseDetailComponent<typeof GetReviewDetailDocument> implements OnInit, OnDestroy {
export class ReviewDetailComponent extends TypedBaseDetailComponent<typeof GetReviewDetailDocument, 'review'> implements OnInit, OnDestroy {
detailForm = this.formBuilder.group({
title: [''],
rating: [1],
Expand Down Expand Up @@ -207,7 +207,7 @@ import { GetReviewDocument, GetReviewDetailQuery } from './generated-types';
const review$ = inject(DataService)
.query(GetReviewDocument, { id: route.paramMap.get('id') })
.mapStream(data => data.review);
return of({ detail: { entity: review$ } });
return of({ entity: review$ });
},
},
data: {
Expand All @@ -220,7 +220,7 @@ import { GetReviewDocument, GetReviewDetailQuery } from './generated-types';
link: ['/extensions', 'reviews'],
},
{
label: `${entity.title}`,
label: `${entity?.title ?? 'New Review'}`,
link: [],
},
]),
Expand Down

0 comments on commit 738fe68

Please sign in to comment.