feat: Convert all app files to JS
This commit is contained in:
5
packages/backend/src/apps/todoist/dynamic-data/index.js
Normal file
5
packages/backend/src/apps/todoist/dynamic-data/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import listProjects from './list-projects/index.js';
|
||||
import listSections from './list-sections/index.js';
|
||||
import listLabels from './list-labels/index.js';
|
||||
|
||||
export default [listProjects, listSections, listLabels];
|
||||
@@ -1,5 +0,0 @@
|
||||
import listProjects from './list-projects';
|
||||
import listSections from './list-sections';
|
||||
import listLabels from './list-labels';
|
||||
|
||||
export default [listProjects, listSections, listLabels];
|
||||
@@ -1,13 +1,11 @@
|
||||
import { IGlobalVariable } from '@automatisch/types';
|
||||
|
||||
export default {
|
||||
name: 'List labels',
|
||||
key: 'listLabels',
|
||||
|
||||
async run($: IGlobalVariable) {
|
||||
async run($) {
|
||||
const response = await $.http.get('/labels');
|
||||
|
||||
response.data = response.data.map((label: { name: string }) => {
|
||||
response.data = response.data.map((label) => {
|
||||
return {
|
||||
value: label.name,
|
||||
name: label.name,
|
||||
@@ -1,13 +1,11 @@
|
||||
import { IGlobalVariable } from '@automatisch/types';
|
||||
|
||||
export default {
|
||||
name: 'List projects',
|
||||
key: 'listProjects',
|
||||
|
||||
async run($: IGlobalVariable) {
|
||||
async run($) {
|
||||
const response = await $.http.get('/projects');
|
||||
|
||||
response.data = response.data.map((project: { id: string, name: string }) => {
|
||||
response.data = response.data.map((project) => {
|
||||
return {
|
||||
value: project.id,
|
||||
name: project.name,
|
||||
@@ -0,0 +1,21 @@
|
||||
export default {
|
||||
name: 'List sections',
|
||||
key: 'listSections',
|
||||
|
||||
async run($) {
|
||||
const params = {
|
||||
project_id: $.step.parameters.projectId,
|
||||
};
|
||||
|
||||
const response = await $.http.get('/sections', { params });
|
||||
|
||||
response.data = response.data.map((section) => {
|
||||
return {
|
||||
value: section.id,
|
||||
name: section.name,
|
||||
};
|
||||
});
|
||||
|
||||
return response;
|
||||
},
|
||||
};
|
||||
@@ -1,23 +0,0 @@
|
||||
import { IGlobalVariable } from '@automatisch/types';
|
||||
|
||||
export default {
|
||||
name: 'List sections',
|
||||
key: 'listSections',
|
||||
|
||||
async run($: IGlobalVariable) {
|
||||
const params = {
|
||||
project_id: ($.step.parameters.projectId as string),
|
||||
};
|
||||
|
||||
const response = await $.http.get('/sections', {params});
|
||||
|
||||
response.data = response.data.map((section: { id: string, name: string }) => {
|
||||
return {
|
||||
value: section.id,
|
||||
name: section.name,
|
||||
};
|
||||
});
|
||||
|
||||
return response;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user