update to new model name

This commit is contained in:
Mads Rasmussen
2024-04-04 15:24:05 +02:00
parent d0460e42bc
commit d7a1d45a1f
3 changed files with 6 additions and 10 deletions

View File

@@ -6,13 +6,9 @@ import { UMB_NOTIFICATION_CONTEXT } from '@umbraco-cms/backoffice/notification';
import type {
DirectionModel,
LogLevelModel,
SavedLogSearchPresenationBaseModel,
SavedLogSearchResponseModel,
} from '@umbraco-cms/backoffice/external/backend-api';
// Move to documentation / JSdoc
/* We need to create a new instance of the repository from within the element context. We want the notifications to be displayed in the right context. */
// element -> context -> repository -> (store) -> data source
// All methods should be async and return a promise. Some methods might return an observable as part of the promise response.
export class UmbLogViewerRepository {
#host: UmbControllerHost;
#searchDataSource: UmbLogSearchesServerDataSource;
@@ -36,7 +32,7 @@ export class UmbLogViewerRepository {
return this.#searchDataSource.getAllSavedSearches({ skip, take });
}
async saveSearch({ name, query }: SavedLogSearchPresenationBaseModel) {
async saveSearch({ name, query }: SavedLogSearchResponseModel) {
await this.#init;
this.#searchDataSource.postLogViewerSavedSearch({ name, query });
}

View File

@@ -7,7 +7,7 @@ import type {
PagedLogMessageResponseModel,
PagedLogTemplateResponseModel,
PagedSavedLogSearchResponseModel,
SavedLogSearchPresenationBaseModel,
SavedLogSearchResponseModel,
} from '@umbraco-cms/backoffice/external/backend-api';
import { DirectionModel, LogLevelModel } from '@umbraco-cms/backoffice/external/backend-api';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
@@ -213,7 +213,7 @@ export class UmbLogViewerWorkspaceContext extends UmbControllerBase implements U
}
}
async saveSearch({ name, query }: SavedLogSearchPresenationBaseModel) {
async saveSearch({ name, query }: SavedLogSearchResponseModel) {
const previousSavedSearches = this.#savedSearches.getValue()?.items ?? [];
try {
this.#savedSearches.update({ items: [...previousSavedSearches, { name, query }] });

View File

@@ -1,13 +1,13 @@
import { html, css, customElement, query, state } from '@umbraco-cms/backoffice/external/lit';
import type { UUIInputElement } from '@umbraco-cms/backoffice/external/uui';
import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';
import type { SavedLogSearchPresenationBaseModel } from '@umbraco-cms/backoffice/external/backend-api';
import type { SavedLogSearchResponseModel } from '@umbraco-cms/backoffice/external/backend-api';
export interface UmbContextSaveSearchModalData {
query: string;
}
export interface UmbContextSaveSearchModalValue extends SavedLogSearchPresenationBaseModel {}
export interface UmbContextSaveSearchModalValue extends SavedLogSearchResponseModel {}
@customElement('umb-log-viewer-save-search-modal')
export default class UmbLogViewerSaveSearchModalElement extends UmbModalBaseElement<