Open brandongregoryscott opened 4 years ago
Similiar to #46, the ServiceFactory.delete signature and implementation should be updated for greater flexibility.
ServiceFactory.delete
It should look something like this:
/** * Creates conventional Service Delete function for the supplied resource type * @param recordType * @param resourceEndpoint */ delete<TPathParams extends any>(resourceEndpoint: string): DeleteService { return async (id: number, pathParams?: TPathParams) => await _delete<TPathParams>(id, resourceEndpoint, pathParams); }, // --------------------------------------------------------------------------------------------- // #region Private Functions // --------------------------------------------------------------------------------------------- const _delete = async function<TPathParams extends any>( id: number, resourceEndpoint: string, pathParams?: TPathParams ) { const url = _buildUrl(id, resourceEndpoint, pathParams); return await axios .delete(url) .then((r) => ServiceUtils.mapAxiosResponse(Boolean, r)); };
Similiar to #46, the
ServiceFactory.delete
signature and implementation should be updated for greater flexibility.It should look something like this: