feat: Convert all app files to JS

This commit is contained in:
Faruk AYDIN
2024-01-05 17:44:21 +01:00
parent b95478b635
commit 43dba351c3
1030 changed files with 5114 additions and 6436 deletions

View 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];

View File

@@ -1,5 +0,0 @@
import listProjects from './list-projects';
import listSections from './list-sections';
import listLabels from './list-labels';
export default [listProjects, listSections, listLabels];

View File

@@ -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,

View File

@@ -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,

View File

@@ -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;
},
};

View File

@@ -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;
},
};