fix: format

This commit is contained in:
amhsirak
2025-01-01 23:31:37 +05:30
parent 3b9e30ddae
commit 52aefd1c0f

View File

@@ -3,7 +3,7 @@ import { emptyWorkflow } from "../shared/constants";
import { default as axios, AxiosResponse } from "axios";
import { apiUrl } from "../apiConfig";
export const getActiveWorkflow = async(id: string) : Promise<WorkflowFile> => {
export const getActiveWorkflow = async (id: string): Promise<WorkflowFile> => {
try {
const response = await axios.get(`${apiUrl}/workflow/${id}`)
if (response.status === 200) {
@@ -11,13 +11,13 @@ export const getActiveWorkflow = async(id: string) : Promise<WorkflowFile> => {
} else {
throw new Error('Something went wrong when fetching a recorded workflow');
}
} catch(error: any) {
} catch (error: any) {
console.log(error);
return emptyWorkflow;
}
};
export const getParamsOfActiveWorkflow = async(id: string) : Promise<string[]|null> => {
export const getParamsOfActiveWorkflow = async (id: string): Promise<string[] | null> => {
try {
const response = await axios.get(`${apiUrl}/workflow/params/${id}`)
if (response.status === 200) {
@@ -25,15 +25,15 @@ export const getParamsOfActiveWorkflow = async(id: string) : Promise<string[]|nu
} else {
throw new Error('Something went wrong when fetching the parameters of the recorded workflow');
}
} catch(error: any) {
} catch (error: any) {
console.log(error);
return null;
}
};
export const deletePair = async(index: number): Promise<WorkflowFile> => {
export const deletePair = async (index: number): Promise<WorkflowFile> => {
try {
const response = await axios.delete(`${apiUrl}/workflow/pair/${index}`);
const response = await axios.delete(`${apiUrl}/workflow/pair/${index}`);
if (response.status === 200) {
return response.data;
} else {
@@ -45,11 +45,11 @@ export const deletePair = async(index: number): Promise<WorkflowFile> => {
}
};
export const AddPair = async(index: number, pair: WhereWhatPair): Promise<WorkflowFile> => {
export const AddPair = async (index: number, pair: WhereWhatPair): Promise<WorkflowFile> => {
try {
const response = await axios.post(`${apiUrl}/workflow/pair/${index}`, {
pair,
}, {headers: {'Content-Type': 'application/json'}});
}, { headers: { 'Content-Type': 'application/json' } });
if (response.status === 200) {
return response.data;
} else {
@@ -61,11 +61,11 @@ export const AddPair = async(index: number, pair: WhereWhatPair): Promise<Workfl
}
};
export const UpdatePair = async(index: number, pair: WhereWhatPair): Promise<WorkflowFile> => {
export const UpdatePair = async (index: number, pair: WhereWhatPair): Promise<WorkflowFile> => {
try {
const response = await axios.put(`${apiUrl}/workflow/pair/${index}`, {
pair,
}, {headers: {'Content-Type': 'application/json'}});
}, { headers: { 'Content-Type': 'application/json' } });
if (response.status === 200) {
return response.data;
} else {