Refactored code to always encode the RequestParams

This commit is contained in:
Alexandre Vryghem
2024-03-24 13:32:25 +01:00
parent 404ccd9b0e
commit d5cf236938
9 changed files with 34 additions and 66 deletions

View File

@@ -16,6 +16,7 @@ import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
import { RemoteData } from '../data/remote-data';
import { PaginatedList } from '../data/paginated-list.model';
import { dataService } from '../data/base/data-service.decorator';
import { RequestParam } from '../cache/models/request-param.model';
@Injectable()
@dataService(SUBMISSION_CC_LICENSE_URL)
@@ -43,17 +44,8 @@ export class SubmissionCcLicenseUrlDataService extends BaseDataService<Submissio
return this.searchData.getSearchByHref(
'rightsByQuestions',{
searchParams: [
{
fieldName: 'license',
fieldValue: ccLicense.id
},
...ccLicense.fields.map(
(field) => {
return {
fieldName: `answer_${field.id}`,
fieldValue: options.get(field).id,
};
}),
new RequestParam('license', ccLicense.id),
...ccLicense.fields.map((field: Field) => new RequestParam(`answer_${field.id}`, options.get(field).id)),
]
}
).pipe(