🔨 refactor(API): add type to updateFlowInDatabase function and format code

The updateFlowInDatabase function now has a type added to it, which improves the readability of the code. The code has also been formatted to improve consistency with the rest of the codebase.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-15 15:08:14 -03:00
commit cb7c8b45cd

View file

@ -111,7 +111,9 @@ export async function saveFlowToDatabase(newFlow: {
* @returns {Promise<any>} The updated flow data.
* @throws Will throw an error if the update fails.
*/
export async function updateFlowInDatabase(updatedFlow: FlowType) {
export async function updateFlowInDatabase(
updatedFlow: FlowType
): Promise<FlowType> {
try {
const response = await axios.patch(`/api/v1/flows/${updatedFlow.id}`, {
name: updatedFlow.name,