93219: Simplify DataService feature interfaces

Get rid of optional methods
- createPatchFromCache is useful -> make required
- leave getFindAllHref and getSearchByHref out & use implementation directly or refactor usages
This commit is contained in:
Yury Bondarenko
2022-09-12 17:34:25 +02:00
parent c32e4ad7c7
commit 8b4dbbad55
23 changed files with 86 additions and 192 deletions

View File

@@ -20,7 +20,7 @@ import { dataService } from '../data/base/data-service.decorator';
@Injectable()
@dataService(SUBMISSION_CC_LICENSE_URL)
export class SubmissionCcLicenseUrlDataService extends BaseDataService<SubmissionCcLicenceUrl> implements SearchData<SubmissionCcLicenceUrl> {
private searchData: SearchData<SubmissionCcLicenceUrl>;
private searchData: SearchDataImpl<SubmissionCcLicenceUrl>;
constructor(
protected requestService: RequestService,
@@ -40,7 +40,7 @@ export class SubmissionCcLicenseUrlDataService extends BaseDataService<Submissio
*/
getCcLicenseLink(ccLicense: SubmissionCcLicence, options: Map<Field, Option>): Observable<string> {
return this.getSearchByHref(
return this.searchData.getSearchByHref(
'rightsByQuestions',{
searchParams: [
{
@@ -64,19 +64,6 @@ export class SubmissionCcLicenseUrlDataService extends BaseDataService<Submissio
);
}
/**
* Create the HREF for a specific object's search method with given options object
*
* @param searchMethod The search method for the object
* @param options The [[FindListOptions]] object
* @return {Observable<string>}
* Return an observable that emits created HREF
* @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved
*/
public getSearchByHref(searchMethod: string, options?: FindListOptions, ...linksToFollow: FollowLinkConfig<SubmissionCcLicenceUrl>[]): Observable<string> {
return this.searchData.getSearchByHref(searchMethod, options, ...linksToFollow);
}
/**
* Make a new FindListRequest with given search method
*