Skip to content

Commit 533f6fe

Browse files
committed
fix schema picture issue
1 parent 03eea2e commit 533f6fe

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/app/features/schemas/edit/edit.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
</mat-form-field>
5959

6060
<ll-schema-asset-select
61-
[space]="selectedSpace"
61+
[spaceId]="spaceId"
6262
[assetId]="form.controls['previewImage'].value"
6363
(assetChange)="form.controls['previewImage'].setValue($event)" />
6464

src/app/features/schemas/shared/asset-select/asset-select.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
height="200"
2020
alt="thumbnail"
2121
loading="lazy"
22-
ngSrc="/api/v1/spaces/{{ space?.id }}/assets/{{ asset.id }}" />
22+
ngSrc="/api/v1/spaces/{{ spaceId }}/assets/{{ asset.id }}" />
2323
</ng-container>
2424
<ng-template #noImage>
2525
<mat-icon>file_present</mat-icon>

src/app/features/schemas/shared/asset-select/asset-select.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { AssetFileType } from '@shared/models/schema.model';
1919
changeDetection: ChangeDetectionStrategy.OnPush,
2020
})
2121
export class AssetSelectComponent implements OnInit {
22-
@Input({ required: true }) space?: Space;
22+
@Input({ required: true }) spaceId!: string;
2323
@Input() assetId?: string;
2424
@Output() assetChange = new EventEmitter<string | undefined>();
2525
asset?: AssetFile;
@@ -40,7 +40,7 @@ export class AssetSelectComponent implements OnInit {
4040

4141
loadData(): void {
4242
if (this.assetId) {
43-
this.assetService.findById(this.space!.id, this.assetId).subscribe({
43+
this.assetService.findById(this.spaceId, this.assetId).subscribe({
4444
next: asset => {
4545
if (asset.kind === AssetKind.FILE) {
4646
this.asset = asset;
@@ -59,7 +59,7 @@ export class AssetSelectComponent implements OnInit {
5959
maxWidth: '1280px',
6060
maxHeight: 'calc(100vh - 80px)',
6161
data: {
62-
spaceId: this.space!.id,
62+
spaceId: this.spaceId,
6363
multiple: false,
6464
fileType: AssetFileType.IMAGE,
6565
},

0 commit comments

Comments
 (0)