Commit graph

10 commits

Author SHA1 Message Date
Jakob Ackermann
dd4f4057f4 [misc] add a new endpoint for changing a docs meta data -- incl. deleted
- Validate the request payload with joi -- includes acceptance tests.
- Reject updates to docs that have been deleted.
2021-02-15 13:13:48 +00:00
Jakob Ackermann
2cf9ff7b41 Merge pull request #89 from overleaf/jpa-is-doc-deleted
[misc] add a new endpoint for querying the deleted status of a doc
2021-02-09 11:14:28 +00:00
Jakob Ackermann
28b1ad3243 [misc] add a new endpoint for querying the deleted status of a doc
`/project/:project_id/doc/:doc_id/deleted` responds with:

- 404: the doc does not exist
- 200 and body `{"deleted":true}`: doc exists and is deleted
- 200 and body `{"deleted":false}`: doc exists and is not deleted
2021-01-15 14:49:27 +00:00
Jakob Ackermann
9298f486ad [app] add a new route for archiving a single doc
There is a minor opportunity for optimizing the mongo call(s) for
 archiving: we should include `{ inS3: false }` in the queries instead
 of filtering locally. It's been like that for years now, so it can
 stay a little longer.
2021-01-04 13:47:55 +00:00
Jakob Ackermann
8a8a830ad3 [misc] simplify mongodb collection access using a shared db construct
Resolve the getCollection Promises once and store the result in a shared
 `db` object which can get imported by all the call-sites.

The http server is starting only after a Promise of `waitForDb()`
 resolves. This covers the app code and the acceptance tests.
2020-09-17 15:39:44 +01:00
Simon Detheridge
a18146612a Remove unhandled-promise-rejection handler 2020-07-31 16:25:33 +01:00
Simon Detheridge
e302c1d844 Update acceptance tests for object-persistor and gcs 2020-07-23 19:43:33 +01:00
Tim Alby
c854f1f570 prettier auto-format 2020-05-28 15:20:54 +02:00
Simon Detheridge
785a6cb544 prettier: convert test/acceptance decaffeinated files to Prettier format 2020-02-17 10:49:20 +00:00
Simon Detheridge
7e131e4c71 decaffeinate: rename test/acceptance/coffee to test/acceptance/js 2020-02-17 10:49:18 +00:00