Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Working version with timeslot function
  • Loading branch information
miquelgall committed Oct 16, 2024
commit 35fe43b3c3b15efa8e6698ca209f7fb455655d2d
7 changes: 7 additions & 0 deletions src/OFS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
OFSPropertyDetails,
OFSPropertyListResponse,
OFSGetPropertiesParams,
OFSTimeslotsResponse,
} from "./model";

export * from "./model";
Expand Down Expand Up @@ -566,4 +567,10 @@ export class OFS {
const partialURL = `/rest/ofscMetadata/v1/properties/${data.label}`;
return this._patch(partialURL, data);
}

//Meta: Timeslots
async getTimeslots(): Promise<OFSTimeslotsResponse> {
const partialURL = `/rest/ofscMetadata/v1/timeSlots`;
return this._get(partialURL);
}
}
21 changes: 19 additions & 2 deletions src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,26 @@ export interface OFSGetPropertiesParams {
offset?: number;
type?: number;
}
class OFSPropertyList {
export class OFSPropertyList {
items: OFSPropertyDetails[] = [];
limit: number = 0;
offset: number = 0;
totalResults: number = 0;
}

export class OFSTimeslot {
active: boolean = false;
isAllDay: boolean = false;
timeEnd: string = "";
timeStart: string = "";
label: string = "";
name: string = "";
}
export class OFSTimeslotsList {
items: OFSTimeslot[] = [];
limit: number = 0;
offset: number = 0;
totalResults: number = 0;
}
export class OFSSubscriptionResponse extends OFSResponse {
data: SubscriptionListResponse = {
totalResults: 0,
Expand Down Expand Up @@ -146,3 +159,7 @@ export class OFSPropertyDetailsResponse extends OFSResponse {
export class OFSPropertyListResponse extends OFSResponse {
data: OFSPropertyList = new OFSPropertyList();
}

export class OFSTimeslotsResponse extends OFSResponse {
data: OFSTimeslotsList = new OFSTimeslotsList();
}