mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 15:03:07 +00:00
58789: Clear index cache and reload lists after adding metadata schema
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<p id="description" class="pb-2">{{'admin.registries.metadata.description' | translate}}</p>
|
||||
|
||||
<ds-metadata-schema-form
|
||||
></ds-metadata-schema-form>
|
||||
(submitForm)="createdSchema($event)"></ds-metadata-schema-form>
|
||||
|
||||
<ds-pagination
|
||||
*ngIf="(metadataSchemas | async)?.payload?.totalElements > 0"
|
||||
|
@@ -62,6 +62,11 @@ export class MetadataRegistryComponent {
|
||||
);
|
||||
}
|
||||
|
||||
createdSchema(event) {
|
||||
this.registryService.clearMetadataSchemaRequests().subscribe((value) => console.log('cleared for substring: ' + value));
|
||||
this.updateSchemas();
|
||||
}
|
||||
|
||||
deleteSchemas() {
|
||||
this.registryService.getSelectedMetadataSchemas().subscribe(
|
||||
(schemas) => {
|
||||
|
@@ -104,6 +104,7 @@ export class MetadataSchemaFormComponent implements OnInit {
|
||||
if (schema == null) {
|
||||
this.registryService.createOrUpdateMetadataSchema(Object.assign(new MetadataSchema(), values)).subscribe((newSchema) => {
|
||||
console.log(newSchema);
|
||||
this.submitForm.emit(newSchema);
|
||||
// TODO: Reload the list of schemas
|
||||
});
|
||||
} else {
|
||||
|
@@ -370,4 +370,10 @@ export class RegistryService {
|
||||
getResponseFromEntry()
|
||||
);
|
||||
}
|
||||
|
||||
public clearMetadataSchemaRequests(): Observable<string> {
|
||||
return this.halService.getEndpoint(this.metadataSchemasPath).pipe(
|
||||
tap((href: string) => this.requestService.removeByHrefSubstring(href))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user