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