Fully generic CRUD pages

This commit is contained in:
2023-01-18 19:43:13 +01:00
parent 15f101eb9f
commit ddb3706e44
9 changed files with 84 additions and 62 deletions

View File

@@ -1,4 +1,4 @@
import {CrudService} from "./crud.service";
import {ApiService} from "./crud.service";
import {Observable} from "rxjs";
import {Injectable} from "@angular/core";
@@ -9,12 +9,12 @@ import {Injectable} from "@angular/core";
export class JsonschemasService {
private rawSchemas: any | null = null;
constructor(private crudService: CrudService) {}
constructor(private apiService: ApiService) {}
getSchemas(): Observable<Schema> {
return new Observable<Schema>((observer) => {
if (this.rawSchemas === null) {
this.crudService.getSchema().subscribe((jsonSchemas: any) => {
this.apiService.getSchema().subscribe((jsonSchemas: any) => {
this.rawSchemas = jsonSchemas;
observer.next(this.rawSchemas)
});