From 8ba87443ca7d84f0d650943e2161d22b1844f1a9 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 23 Oct 2018 07:01:43 +0900 Subject: [PATCH] Use camelCase instead of snake_case --- src/client/app/desktop/views/components/drive.vue | 10 +++++----- src/client/app/mobile/views/components/drive.vue | 10 +++++----- src/server/api/endpoints/drive/files/delete.ts | 4 ++-- src/server/api/endpoints/drive/files/update.ts | 4 ++-- src/server/api/endpoints/drive/folders/create.ts | 4 ++-- src/server/api/endpoints/drive/folders/update.ts | 4 ++-- src/services/drive/add-file.ts | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/client/app/desktop/views/components/drive.vue b/src/client/app/desktop/views/components/drive.vue index 1376a04d9..054ba8b35 100644 --- a/src/client/app/desktop/views/components/drive.vue +++ b/src/client/app/desktop/views/components/drive.vue @@ -117,11 +117,11 @@ export default Vue.extend({ mounted() { this.connection = (this as any).os.stream.useSharedConnection('drive'); - this.connection.on('file_created', this.onStreamDriveFileCreated); - this.connection.on('file_updated', this.onStreamDriveFileUpdated); - this.connection.on('file_deleted', this.onStreamDriveFileDeleted); - this.connection.on('folder_created', this.onStreamDriveFolderCreated); - this.connection.on('folder_updated', this.onStreamDriveFolderUpdated); + this.connection.on('fileCreated', this.onStreamDriveFileCreated); + this.connection.on('fileUpdated', this.onStreamDriveFileUpdated); + this.connection.on('fileDeleted', this.onStreamDriveFileDeleted); + this.connection.on('folderCreated', this.onStreamDriveFolderCreated); + this.connection.on('folderUpdated', this.onStreamDriveFolderUpdated); if (this.initFolder) { this.move(this.initFolder); diff --git a/src/client/app/mobile/views/components/drive.vue b/src/client/app/mobile/views/components/drive.vue index 469f6da24..4daa691d9 100644 --- a/src/client/app/mobile/views/components/drive.vue +++ b/src/client/app/mobile/views/components/drive.vue @@ -103,11 +103,11 @@ export default Vue.extend({ mounted() { this.connection = (this as any).os.stream.useSharedConnection('drive'); - this.connection.on('file_created', this.onStreamDriveFileCreated); - this.connection.on('file_updated', this.onStreamDriveFileUpdated); - this.connection.on('file_deleted', this.onStreamDriveFileDeleted); - this.connection.on('folder_created', this.onStreamDriveFolderCreated); - this.connection.on('folder_updated', this.onStreamDriveFolderUpdated); + this.connection.on('fileCreated', this.onStreamDriveFileCreated); + this.connection.on('fileUpdated', this.onStreamDriveFileUpdated); + this.connection.on('fileDeleted', this.onStreamDriveFileDeleted); + this.connection.on('folderCreated', this.onStreamDriveFolderCreated); + this.connection.on('folderUpdated', this.onStreamDriveFolderUpdated); if (this.initFolder) { this.cd(this.initFolder, true); diff --git a/src/server/api/endpoints/drive/files/delete.ts b/src/server/api/endpoints/drive/files/delete.ts index e29e330aa..fc6849e57 100644 --- a/src/server/api/endpoints/drive/files/delete.ts +++ b/src/server/api/endpoints/drive/files/delete.ts @@ -45,8 +45,8 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = // Delete await del(file); - // Publish file_deleted event - publishDriveStream(user._id, 'file_deleted', file._id); + // Publish fileDeleted event + publishDriveStream(user._id, 'fileDeleted', file._id); res(); }); diff --git a/src/server/api/endpoints/drive/files/update.ts b/src/server/api/endpoints/drive/files/update.ts index 9b8c53caf..915cf4ceb 100644 --- a/src/server/api/endpoints/drive/files/update.ts +++ b/src/server/api/endpoints/drive/files/update.ts @@ -114,6 +114,6 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = // Response res(fileObj); - // Publish file_updated event - publishDriveStream(user._id, 'file_updated', fileObj); + // Publish fileUpdated event + publishDriveStream(user._id, 'fileUpdated', fileObj); }); diff --git a/src/server/api/endpoints/drive/folders/create.ts b/src/server/api/endpoints/drive/folders/create.ts index 5997dedf0..f83fe46cd 100644 --- a/src/server/api/endpoints/drive/folders/create.ts +++ b/src/server/api/endpoints/drive/folders/create.ts @@ -52,6 +52,6 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = // Response res(folderObj); - // Publish folder_created event - publishDriveStream(user._id, 'folder_created', folderObj); + // Publish folderCreated event + publishDriveStream(user._id, 'folderCreated', folderObj); }); diff --git a/src/server/api/endpoints/drive/folders/update.ts b/src/server/api/endpoints/drive/folders/update.ts index 259f373bf..479dd2fd4 100644 --- a/src/server/api/endpoints/drive/folders/update.ts +++ b/src/server/api/endpoints/drive/folders/update.ts @@ -96,6 +96,6 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = // Response res(folderObj); - // Publish folder_updated event - publishDriveStream(user._id, 'folder_updated', folderObj); + // Publish folderUpdated event + publishDriveStream(user._id, 'folderUpdated', folderObj); }); diff --git a/src/services/drive/add-file.ts b/src/services/drive/add-file.ts index ea5a295e0..4a06b62ae 100644 --- a/src/services/drive/add-file.ts +++ b/src/services/drive/add-file.ts @@ -396,7 +396,7 @@ export default async function( pack(driveFile).then(packedFile => { // Publish driveFileCreated event publishMainStream(user._id, 'driveFileCreated', packedFile); - publishDriveStream(user._id, 'file_created', packedFile); + publishDriveStream(user._id, 'fileCreated', packedFile); }); // 統計を更新