Browse Source

fix(nocodb): include calendar range in calendar get api

pull/7611/head
DarkPhoenix2704 9 months ago
parent
commit
0d0f700209
  1. 12
      packages/nocodb/src/services/calendars.service.ts

12
packages/nocodb/src/services/calendars.service.ts

@ -6,6 +6,7 @@ import {AppHooksService} from '~/services/app-hooks/app-hooks.service';
import {validatePayload} from '~/helpers'; import {validatePayload} from '~/helpers';
import {NcError} from '~/helpers/catchError'; import {NcError} from '~/helpers/catchError';
import {CalendarView, View} from '~/models'; import {CalendarView, View} from '~/models';
import CalendarRange from "~/models/CalendarRange";
@Injectable() @Injectable()
export class CalendarsService { export class CalendarsService {
@ -13,7 +14,16 @@ export class CalendarsService {
} }
async calendarViewGet(param: { calendarViewId: string }) { async calendarViewGet(param: { calendarViewId: string }) {
return await CalendarView.get(param.calendarViewId); const calendarView = await CalendarView.get(param.calendarViewId);
if (!calendarView) {
NcError.badRequest('Calendar view not found');
}
const calendarRanges = await CalendarRange.read(param.calendarViewId)
return {
...calendarView,
calendar_range: calendarRanges
};
} }
async calendarViewCreate(param: { async calendarViewCreate(param: {

Loading…
Cancel
Save