mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Merge pull request #33315 from overleaf/em-library-api-pagination
Add cursor-based pagination to GET /library/references GitOrigin-RevId: 1acec69031b0ca82ef6e1e05eddb165acaf05003
This commit is contained in:
@@ -616,6 +616,7 @@
|
|||||||
"entry_plural": "",
|
"entry_plural": "",
|
||||||
"equation_preview": "",
|
"equation_preview": "",
|
||||||
"error": "",
|
"error": "",
|
||||||
|
"error_loading_references": "",
|
||||||
"error_opening_document": "",
|
"error_opening_document": "",
|
||||||
"error_opening_document_detail": "",
|
"error_opening_document_detail": "",
|
||||||
"error_performing_request": "",
|
"error_performing_request": "",
|
||||||
|
|||||||
@@ -807,6 +807,7 @@
|
|||||||
"equation_preview": "Equation preview",
|
"equation_preview": "Equation preview",
|
||||||
"error": "Error",
|
"error": "Error",
|
||||||
"error_assist": "Error Assist",
|
"error_assist": "Error Assist",
|
||||||
|
"error_loading_references": "References couldn’t be loaded. Refresh the page to try again.",
|
||||||
"error_opening_document": "Error opening document",
|
"error_opening_document": "Error opening document",
|
||||||
"error_opening_document_detail": "Sorry, something went wrong opening this document. Please try again.",
|
"error_opening_document_detail": "Sorry, something went wrong opening this document. Please try again.",
|
||||||
"error_performing_request": "An error has occurred while performing your request.",
|
"error_performing_request": "An error has occurred while performing your request.",
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import Helpers from './lib/helpers.mjs'
|
||||||
|
|
||||||
|
const tags = ['saas']
|
||||||
|
|
||||||
|
const oldIndex = {
|
||||||
|
key: { userId: 1, updatedAt: 1 },
|
||||||
|
name: 'userId_1_updatedAt_1',
|
||||||
|
}
|
||||||
|
|
||||||
|
const newIndex = {
|
||||||
|
key: { userId: 1, updatedAt: 1, _id: 1 },
|
||||||
|
name: 'userId_1_updatedAt_1__id_1',
|
||||||
|
}
|
||||||
|
|
||||||
|
const migrate = async client => {
|
||||||
|
const { db } = client
|
||||||
|
await Helpers.addIndexesToCollection(db.libraryReferences, [newIndex])
|
||||||
|
await Helpers.dropIndexesFromCollection(db.libraryReferences, [oldIndex])
|
||||||
|
}
|
||||||
|
|
||||||
|
const rollback = async client => {
|
||||||
|
const { db } = client
|
||||||
|
await Helpers.addIndexesToCollection(db.libraryReferences, [oldIndex])
|
||||||
|
await Helpers.dropIndexesFromCollection(db.libraryReferences, [newIndex])
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
tags,
|
||||||
|
migrate,
|
||||||
|
rollback,
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user