Merge pull request #9755 from overleaf/jpa-dropbox-use-project-id-from-web

[misc] let web feed back projectId to resolve "unknown project" updates

GitOrigin-RevId: d005370e7a1e7a4a5d9e54d62e47dfff3541f8f1
This commit is contained in:
Jakob Ackermann
2022-09-27 15:59:43 +01:00
committed by Copybot
parent 3e2b16cbfe
commit 13acf0dbd7
3 changed files with 5 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ async function mergeUpdate(req, res) {
const payload = {
status: 'applied',
projectId: metadata.projectId.toString(),
entityId: metadata.entityId.toString(),
entityType: metadata.entityType,
folderId: metadata.folderId.toString(),

View File

@@ -83,6 +83,7 @@ async function _mergeUpdate(userId, projectId, path, fsPath, source) {
userId
)
return {
projectId,
entityType: 'file',
entityId: file._id,
rev: file.rev,
@@ -97,6 +98,7 @@ async function _mergeUpdate(userId, projectId, path, fsPath, source) {
source
)
return {
projectId,
entityType: 'doc',
entityId: doc._id,
rev: doc.rev,

View File

@@ -10,6 +10,7 @@ const MODULE_PATH =
describe('TpdsController', function () {
beforeEach(function () {
this.metadata = {
projectId: ObjectId(),
entityId: ObjectId(),
folderId: ObjectId(),
entityType: 'doc',
@@ -74,6 +75,7 @@ describe('TpdsController', function () {
json: payload => {
expect(payload).to.deep.equal({
status: 'applied',
projectId: this.metadata.projectId.toString(),
entityId: this.metadata.entityId.toString(),
folderId: this.metadata.folderId.toString(),
entityType: this.metadata.entityType,