Skip to content

Commit 876f639

Browse files
committed
Adjustments on search activity
1 parent fa5b901 commit 876f639

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

src/OFS.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ export class OFS {
624624
offset: number = 0,
625625
limit: number = 100
626626
): Promise<OFSResponse> {
627-
const partialURL = "/rest/ofscCore/v1/activities";
627+
const partialURL = "/rest/ofscCore/v1/activities/custom-actions/search";
628628
return this._get(partialURL, {
629629
...params,
630630
offset: offset,

src/model.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,13 @@ export interface OFSGetActivitiesParams {
175175
}
176176

177177
export interface OFSSearchForActivitiesParams {
178-
dateFrom?: string;
179-
dateTo?: string;
178+
dateFrom: string;
179+
dateTo: string;
180+
searchForValue: string;
181+
searchInField: string;
180182
fields?: string;
181183
includeMultiday?: string;
182184
includeNonScheduled?: boolean;
183-
searchForValue: string;
184-
searchInField: string;
185185
}
186186

187187
export interface OFSBulkUpdateRequestInterface {

test/general/core.activities.test.ts

+19-5
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ test("Bulk Update Activities", async () => {
7878

7979
// Perform bulk update
8080
var bulkUpdateResult = await myProxy.bulkUpdateActivity(bulkUpdateData);
81-
console.log(
82-
`BULK UPDATE RESPONSE ${JSON.stringify(bulkUpdateResult.data, null, 2)}`
83-
);
8481
expect(bulkUpdateResult.data.results.length).toBe(2);
8582
});
8683

@@ -327,19 +324,36 @@ test("Get Activities", async () => {
327324
});
328325

329326
test("Search for Activities", async () => {
327+
var currentDate = new Date().toISOString().split("T")[0];
330328
var result = await myProxy.searchForActivities(
331329
{
330+
dateFrom: currentDate,
331+
dateTo: currentDate,
332332
searchForValue: "137165209",
333333
searchInField: "apptNumber",
334334
},
335335
0,
336336
100
337337
);
338338
if (result.status !== 200) {
339-
console.log(result);
339+
console.log(
340+
`Search for Activities ERROR: ${JSON.stringify(
341+
result.data,
342+
null,
343+
2
344+
)}`
345+
);
346+
} else {
347+
console.log(
348+
`Search for Activities Result: ${JSON.stringify(
349+
result.data,
350+
null,
351+
2
352+
)}`
353+
);
340354
}
341355
expect(result.status).toBe(200);
342-
expect(result.data.items.length).toBe(1);
356+
expect(result.data.items.length).toBe(2);
343357
});
344358

345359
test("Get Activities with includeChildren", async () => {

0 commit comments

Comments
 (0)