mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 20:00:02 +00:00
fix(core): Ensure updatedAt field exists on folder object for source control (#16437)
This commit is contained in:
@@ -216,10 +216,10 @@ export class SourceControlController {
|
|||||||
@Get('/get-status', { middlewares: [sourceControlLicensedAndEnabledMiddleware] })
|
@Get('/get-status', { middlewares: [sourceControlLicensedAndEnabledMiddleware] })
|
||||||
async getStatus(req: SourceControlRequest.GetStatus) {
|
async getStatus(req: SourceControlRequest.GetStatus) {
|
||||||
try {
|
try {
|
||||||
const result = (await this.sourceControlService.getStatus(
|
const result = await this.sourceControlService.getStatus(
|
||||||
req.user,
|
req.user,
|
||||||
new SourceControlGetStatus(req.query),
|
new SourceControlGetStatus(req.query),
|
||||||
)) as SourceControlledFile[];
|
);
|
||||||
return result;
|
return result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new BadRequestError((error as { message: string }).message);
|
throw new BadRequestError((error as { message: string }).message);
|
||||||
|
|||||||
@@ -963,6 +963,8 @@ export class SourceControlService {
|
|||||||
select: ['updatedAt'],
|
select: ['updatedAt'],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const lastUpdatedDate = lastUpdatedFolder[0]?.updatedAt ?? new Date();
|
||||||
|
|
||||||
const foldersMappingsRemote =
|
const foldersMappingsRemote =
|
||||||
await this.sourceControlImportService.getRemoteFoldersAndMappingsFromFile(context);
|
await this.sourceControlImportService.getRemoteFoldersAndMappingsFromFile(context);
|
||||||
const foldersMappingsLocal =
|
const foldersMappingsLocal =
|
||||||
@@ -999,7 +1001,7 @@ export class SourceControlService {
|
|||||||
location: options.direction === 'push' ? 'local' : 'remote',
|
location: options.direction === 'push' ? 'local' : 'remote',
|
||||||
conflict: false,
|
conflict: false,
|
||||||
file: getFoldersPath(this.gitFolder),
|
file: getFoldersPath(this.gitFolder),
|
||||||
updatedAt: lastUpdatedFolder[0]?.updatedAt.toISOString(),
|
updatedAt: lastUpdatedDate.toISOString(),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
foldersMissingInRemote.forEach((item) => {
|
foldersMissingInRemote.forEach((item) => {
|
||||||
@@ -1011,7 +1013,7 @@ export class SourceControlService {
|
|||||||
location: options.direction === 'push' ? 'local' : 'remote',
|
location: options.direction === 'push' ? 'local' : 'remote',
|
||||||
conflict: options.direction === 'push' ? false : true,
|
conflict: options.direction === 'push' ? false : true,
|
||||||
file: getFoldersPath(this.gitFolder),
|
file: getFoldersPath(this.gitFolder),
|
||||||
updatedAt: lastUpdatedFolder[0]?.updatedAt.toISOString(),
|
updatedAt: lastUpdatedDate.toISOString(),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user