feat: Add name column to Step model

This commit is contained in:
Faruk AYDIN
2025-01-06 16:42:00 +03:00
parent f9731824eb
commit bc87e18d3f
16 changed files with 58 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ class Step extends Base {
id: { type: 'string', format: 'uuid' },
flowId: { type: 'string', format: 'uuid' },
key: { type: ['string', 'null'] },
name: { type: ['string', 'null'], minLength: 1, maxLength: 255 },
appKey: { type: ['string', 'null'], minLength: 1, maxLength: 255 },
type: { type: 'string', enum: ['action', 'trigger'] },
connectionId: { type: ['string', 'null'], format: 'uuid' },
@@ -314,7 +315,13 @@ class Step extends Base {
}
async updateFor(user, newStepData) {
const { appKey = this.appKey, connectionId, key, parameters } = newStepData;
const {
appKey = this.appKey,
name,
connectionId,
key,
parameters,
} = newStepData;
if (connectionId && appKey) {
await user.authorizedConnections
@@ -335,6 +342,7 @@ class Step extends Base {
const updatedStep = await this.$query().patchAndFetch({
key,
name,
appKey,
connectionId: connectionId,
parameters: parameters,