semantic markup update
This commit is contained in:
@@ -4,6 +4,11 @@
|
||||
|
||||
const API_BASE = '/api/settings/connections';
|
||||
|
||||
// [DEF:getConnections:Function]
|
||||
/* @PURPOSE: Fetch a list of saved connections.
|
||||
@PRE: None.
|
||||
@POST: Returns a promise resolving to an array of connections.
|
||||
*/
|
||||
/**
|
||||
* Fetch a list of saved connections.
|
||||
* @returns {Promise<Array>} List of connections.
|
||||
@@ -15,7 +20,13 @@ export async function getConnections() {
|
||||
}
|
||||
return await response.json();
|
||||
}
|
||||
// [/DEF:getConnections:Function]
|
||||
|
||||
// [DEF:createConnection:Function]
|
||||
/* @PURPOSE: Create a new connection configuration.
|
||||
@PRE: connectionData must be a valid object.
|
||||
@POST: Returns a promise resolving to the created connection.
|
||||
*/
|
||||
/**
|
||||
* Create a new connection configuration.
|
||||
* @param {Object} connectionData - The connection data.
|
||||
@@ -36,7 +47,13 @@ export async function createConnection(connectionData) {
|
||||
}
|
||||
return await response.json();
|
||||
}
|
||||
// [/DEF:createConnection:Function]
|
||||
|
||||
// [DEF:deleteConnection:Function]
|
||||
/* @PURPOSE: Delete a connection configuration.
|
||||
@PRE: connectionId must be a valid string.
|
||||
@POST: Returns a promise that resolves when deletion is complete.
|
||||
*/
|
||||
/**
|
||||
* Delete a connection configuration.
|
||||
* @param {string} connectionId - The ID of the connection to delete.
|
||||
@@ -49,4 +66,5 @@ export async function deleteConnection(connectionId) {
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to delete connection: ${response.statusText}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
// [/DEF:deleteConnection:Function]
|
||||
Reference in New Issue
Block a user