mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-09-23 02:20:44 +02:00
feat(API): Add Public API endpoint for updating variables (#15315)
This commit is contained in:
@@ -8,9 +8,35 @@ delete:
|
||||
parameters:
|
||||
- $ref: '../schemas/parameters/variableId.yml'
|
||||
responses:
|
||||
'204':
|
||||
'201':
|
||||
description: Operation successful.
|
||||
'401':
|
||||
$ref: '../../../../shared/spec/responses/unauthorized.yml'
|
||||
'404':
|
||||
$ref: '../../../../shared/spec/responses/notFound.yml'
|
||||
|
||||
put:
|
||||
x-eov-operation-id: updateVariable
|
||||
x-eov-operation-handler: v1/handlers/variables/variables.handler
|
||||
tags:
|
||||
- Variables
|
||||
summary: Update a variable
|
||||
description: Update a variable from your instance.
|
||||
requestBody:
|
||||
description: Payload for variable to update.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../schemas/variable.yml'
|
||||
required: true
|
||||
responses:
|
||||
'204':
|
||||
description: Operation successful.
|
||||
'400':
|
||||
$ref: '../../../../shared/spec/responses/badRequest.yml'
|
||||
'401':
|
||||
$ref: '../../../../shared/spec/responses/unauthorized.yml'
|
||||
'403':
|
||||
$ref: '../../../../shared/spec/responses/forbidden.yml'
|
||||
'404':
|
||||
$ref: '../../../../shared/spec/responses/notFound.yml'
|
||||
|
||||
@@ -27,6 +27,15 @@ export = {
|
||||
res.status(201).send();
|
||||
},
|
||||
],
|
||||
updateVariable: [
|
||||
isLicensed('feat:variables'),
|
||||
apiKeyHasScopeWithGlobalScopeFallback({ scope: 'variable:update' }),
|
||||
async (req: VariablesRequest.Update, res: Response) => {
|
||||
await Container.get(VariablesController).updateVariable(req);
|
||||
|
||||
res.status(204).send();
|
||||
},
|
||||
],
|
||||
deleteVariable: [
|
||||
isLicensed('feat:variables'),
|
||||
apiKeyHasScopeWithGlobalScopeFallback({ scope: 'variable:delete' }),
|
||||
|
||||
Reference in New Issue
Block a user