-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Expand file tree
/
Copy pathcreate-list.mjs
More file actions
49 lines (46 loc) · 1.13 KB
/
create-list.mjs
File metadata and controls
49 lines (46 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import sharepoint from "../../sharepoint.app.mjs";
export default {
key: "sharepoint-create-list",
name: "Create List",
description: "Create a new list in Microsoft Sharepoint. [See the documentation](https://learn.microsoft.com/en-us/graph/api/list-create?view=graph-rest-1.0&tabs=http)",
version: "0.0.9",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
sharepoint,
siteId: {
propDefinition: [
sharepoint,
"siteId",
],
},
name: {
type: "string",
label: "Name",
description: "Name of the list",
},
description: {
type: "string",
label: "Description",
description: "Description of the list",
optional: true,
},
},
async run({ $ }) {
const response = await this.sharepoint.createList({
siteId: this.siteId,
data: {
displayName: this.name,
description: this.description,
},
});
if (response?.id) {
$.export("$summary", `Successfully created list with ID ${response.id}.`);
}
return response;
},
};