|
|
@ -104,14 +104,16 @@ export default {
|
|
|
|
return parent.loanTimes ? parent.loanTimes : [];
|
|
|
|
return parent.loanTimes ? parent.loanTimes : [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
TimeFrame: {
|
|
|
|
DateRange: {
|
|
|
|
from (parent: any) {
|
|
|
|
from (parent: any) {
|
|
|
|
return (parent.dateRange as string).split(',')[0].replace('[', '');
|
|
|
|
return (parent as string).split(',')[0].replace('[', '');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
to (parent: any) {
|
|
|
|
to (parent: string) {
|
|
|
|
const str = (parent.dateRange as string).split(',')[1].replace(')', '');
|
|
|
|
const str = (parent as string).split(',')[1].replace(')', '');
|
|
|
|
return (str.length > 0) ? str : null;
|
|
|
|
return (str.length > 0) ? str : null;
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
TimeFrame: {
|
|
|
|
cargoBike (parent: any, __: any, { dataSources, req }: { dataSources: any, req: any }) {
|
|
|
|
cargoBike (parent: any, __: any, { dataSources, req }: { dataSources: any, req: any }) {
|
|
|
|
if (req.permissions.includes(Permission.ReadBike)) {
|
|
|
|
if (req.permissions.includes(Permission.ReadBike)) {
|
|
|
|
return dataSources.cargoBikeAPI.cargoBikeByTimeFrameId(parent.id);
|
|
|
|
return dataSources.cargoBikeAPI.cargoBikeByTimeFrameId(parent.id);
|
|
|
|