fix: files show creation date instead of modification date #700
This commit is contained in:
@@ -1046,7 +1046,7 @@ export class DemoJMAPClient implements IJMAPClient {
|
||||
const node: FileNode = {
|
||||
id: generateDemoId('file'),
|
||||
parentId, name, type: 'd', blobId: null, size: 0,
|
||||
created: new Date().toISOString(), updated: new Date().toISOString(),
|
||||
created: new Date().toISOString(), modified: new Date().toISOString(),
|
||||
};
|
||||
this.data.fileNodes.push(node);
|
||||
return node;
|
||||
@@ -1056,7 +1056,7 @@ export class DemoJMAPClient implements IJMAPClient {
|
||||
const node: FileNode = {
|
||||
id: generateDemoId('file'),
|
||||
parentId, name, type, blobId, size,
|
||||
created: new Date().toISOString(), updated: new Date().toISOString(),
|
||||
created: new Date().toISOString(), modified: new Date().toISOString(),
|
||||
};
|
||||
this.data.fileNodes.push(node);
|
||||
return node;
|
||||
@@ -1064,7 +1064,7 @@ export class DemoJMAPClient implements IJMAPClient {
|
||||
|
||||
async updateFileNode(id: string, updates: Partial<Pick<FileNode, 'name' | 'parentId'>>): Promise<void> {
|
||||
const node = this.data.fileNodes.find(n => n.id === id);
|
||||
if (node) Object.assign(node, updates, { updated: new Date().toISOString() });
|
||||
if (node) Object.assign(node, updates, { modified: new Date().toISOString() });
|
||||
}
|
||||
|
||||
async updateFileNodes(updates: Record<string, Partial<Pick<FileNode, 'name' | 'parentId'>>>): Promise<{ updated: string[]; notUpdated: Record<string, string> }> {
|
||||
@@ -1072,7 +1072,7 @@ export class DemoJMAPClient implements IJMAPClient {
|
||||
for (const [id, patch] of Object.entries(updates)) {
|
||||
const node = this.data.fileNodes.find(n => n.id === id);
|
||||
if (node) {
|
||||
Object.assign(node, patch, { updated: new Date().toISOString() });
|
||||
Object.assign(node, patch, { modified: new Date().toISOString() });
|
||||
updated.push(id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user