Skip to content

Commit b865aa0

Browse files
committed
Adding new action
1 parent a72fc41 commit b865aa0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import motion from "../../motion.app.mjs";
2+
3+
export default {
4+
key: "motion-get-schedules",
5+
name: "Retrieve Schedules",
6+
version: "0.0.1",
7+
description: "Get a list of schedules for your user. [See the documentation](https://docs.usemotion.com/docs/motion-rest-api/f9fec7bb61c6f-get-schedules)",
8+
type: "action",
9+
props: {
10+
motion,
11+
},
12+
methods: {
13+
getSchedules($) {
14+
return this.motion._makeRequest({
15+
$,
16+
path: "schedules",
17+
});
18+
},
19+
},
20+
async run({ $ }) {
21+
const response = await this.getSchedules($);
22+
$.export("$summary", `Successfully fetched ${response?.length} schedules`);
23+
return response;
24+
},
25+
};

0 commit comments

Comments
 (0)