This commit is contained in:
JesmoDev
2024-05-02 10:13:07 +02:00
parent d589e193c7
commit 8dc49006d7
2 changed files with 11 additions and 11 deletions

View File

@@ -1,13 +1,13 @@
import { WebhookService } from '@umbraco-cms/backoffice/external/backend-api';
import type { UmbWebhookDetailModel } from '../../types.js';
import { UmbWebhookServerDataSource } from './webhook-detail.server.data-source.js';
import { UmbWebhookDetailServerDataSource } from './webhook-detail.server.data-source.js';
import { UMB_WEBHOOK_DETAIL_STORE_CONTEXT } from './webhook-detail.store.js';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import { UmbDetailRepositoryBase } from '@umbraco-cms/backoffice/repository';
export class UmbWebhookDetailRepository extends UmbDetailRepositoryBase<UmbWebhookDetailModel> {
constructor(host: UmbControllerHost) {
super(host, UmbWebhookServerDataSource, UMB_WEBHOOK_DETAIL_STORE_CONTEXT);
super(host, UmbWebhookDetailServerDataSource, UMB_WEBHOOK_DETAIL_STORE_CONTEXT);
}
async create(model: UmbWebhookDetailModel) {

View File

@@ -13,16 +13,16 @@ import { tryExecuteAndNotify } from '@umbraco-cms/backoffice/resources';
/**
* A data source for the Webhook that fetches data from the server
* @export
* @class UmbWebhookServerDataSource
* @class UmbWebhookDetailServerDataSource
* @implements {RepositoryDetailDataSource}
*/
export class UmbWebhookServerDataSource implements UmbDetailDataSource<UmbWebhookDetailModel> {
export class UmbWebhookDetailServerDataSource implements UmbDetailDataSource<UmbWebhookDetailModel> {
#host: UmbControllerHost;
/**
* Creates an instance of UmbWebhookServerDataSource.
* Creates an instance of UmbWebhookDetailServerDataSource.
* @param {UmbControllerHost} host
* @memberof UmbWebhookServerDataSource
* @memberof UmbWebhookDetailServerDataSource
*/
constructor(host: UmbControllerHost) {
this.#host = host;
@@ -32,7 +32,7 @@ export class UmbWebhookServerDataSource implements UmbDetailDataSource<UmbWebhoo
* Creates a new Webhook scaffold
* @param {Partial<UmbWebhookDetailModel>} [preset]
* @return { CreateWebhookRequestModel }
* @memberof UmbWebhookServerDataSource
* @memberof UmbWebhookDetailServerDataSource
*/
async createScaffold(preset: Partial<UmbWebhookDetailModel> = {}) {
const data: UmbWebhookDetailModel = {
@@ -53,7 +53,7 @@ export class UmbWebhookServerDataSource implements UmbDetailDataSource<UmbWebhoo
* Fetches a Webhook with the given id from the server
* @param {string} unique
* @return {*}
* @memberof UmbWebhookServerDataSource
* @memberof UmbWebhookDetailServerDataSource
*/
async read(unique: string) {
if (!unique) throw new Error('Unique is missing');
@@ -82,7 +82,7 @@ export class UmbWebhookServerDataSource implements UmbDetailDataSource<UmbWebhoo
* Inserts a new Webhook on the server
* @param {UmbWebhookDetailModel} model
* @return {*}
* @memberof UmbWebhookServerDataSource
* @memberof UmbWebhookDetailServerDataSource
*/
async create(model: UmbWebhookDetailModel) {
if (!model) throw new Error('Webhook is missing');
@@ -115,7 +115,7 @@ export class UmbWebhookServerDataSource implements UmbDetailDataSource<UmbWebhoo
* Updates a Webhook on the server
* @param {UmbWebhookDetailModel} Webhook
* @return {*}
* @memberof UmbWebhookServerDataSource
* @memberof UmbWebhookDetailServerDataSource
*/
async update(model: UmbWebhookDetailModel) {
if (!model.unique) throw new Error('Unique is missing');
@@ -148,7 +148,7 @@ export class UmbWebhookServerDataSource implements UmbDetailDataSource<UmbWebhoo
* Deletes a Webhook on the server
* @param {string} unique
* @return {*}
* @memberof UmbWebhookServerDataSource
* @memberof UmbWebhookDetailServerDataSource
*/
async delete(unique: string) {
if (!unique) throw new Error('Unique is missing');