Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c5ecc7ebf5 |
@@ -1,3 +1,4 @@
|
||||
import createEvent from './create-event/index.js';
|
||||
import publishEvent from './publish-event/index.js';
|
||||
|
||||
export default [createEvent];
|
||||
export default [createEvent, publishEvent];
|
||||
|
@@ -0,0 +1,63 @@
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Publish event',
|
||||
key: 'publishEvent',
|
||||
description: 'Publishes a draft event.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'Organization',
|
||||
key: 'organizationId',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listOrganizations',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Event',
|
||||
key: 'eventId',
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listEvents',
|
||||
},
|
||||
{
|
||||
name: 'parameters.organizationId',
|
||||
value: '{parameters.organizationId}',
|
||||
},
|
||||
{
|
||||
name: 'parameters.unpublished',
|
||||
value: 'true',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const { eventId } = $.step.parameters;
|
||||
|
||||
const { data } = await $.http.post(`/v3/events/${eventId}/publish/`);
|
||||
|
||||
$.setActionItem({
|
||||
raw: data,
|
||||
});
|
||||
},
|
||||
});
|
@@ -7,6 +7,7 @@ export default {
|
||||
data: [],
|
||||
};
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
const unpublished = $.step.parameters.unpublished === 'true';
|
||||
|
||||
if (!organizationId) {
|
||||
return events;
|
||||
@@ -17,6 +18,10 @@ export default {
|
||||
order_by: 'created_desc',
|
||||
};
|
||||
|
||||
if (unpublished) {
|
||||
params.status = 'draft';
|
||||
}
|
||||
|
||||
do {
|
||||
const { data } = await $.http.get(
|
||||
`/v3/organizations/${organizationId}/events/`,
|
||||
|
@@ -3,6 +3,8 @@ favicon: /favicons/eventbrite.svg
|
||||
items:
|
||||
- name: Create event
|
||||
desc: Creates a new event.
|
||||
- name: Publish event
|
||||
desc: Publishes a draft event.
|
||||
---
|
||||
|
||||
<script setup>
|
||||
|
Reference in New Issue
Block a user