mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
[project-history] update getProjectBlobSchema to accept numeric history_id
GitOrigin-RevId: b38d8c9e279e227975a12662d3f0c9e0d21cc1bd
This commit is contained in:
committed by
Copybot
parent
9970dd907a
commit
9bd7171413
@@ -23,7 +23,7 @@ const ONE_DAY_IN_SECONDS = 24 * 60 * 60
|
|||||||
|
|
||||||
const getProjectBlobSchema = z.object({
|
const getProjectBlobSchema = z.object({
|
||||||
params: z.object({
|
params: z.object({
|
||||||
history_id: zz.objectId(),
|
history_id: zz.objectId().or(z.coerce.number()),
|
||||||
hash: z.string(),
|
hash: z.string(),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -136,4 +136,20 @@ describe('NumericProjectId', function () {
|
|||||||
})
|
})
|
||||||
expect(response.statusCode).to.equal(200)
|
expect(response.statusCode).to.equal(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should accept numeric history_id for getProjectBlob', async function () {
|
||||||
|
const blobHash = 'a'.repeat(40)
|
||||||
|
const blobContent = 'test blob content'
|
||||||
|
|
||||||
|
MockHistoryStore()
|
||||||
|
.get(`/api/projects/${this.historyId}/blobs/${blobHash}`)
|
||||||
|
.reply(200, blobContent)
|
||||||
|
|
||||||
|
const { response, body } = await makeRequest({
|
||||||
|
method: 'GET',
|
||||||
|
url: `http://127.0.0.1:3054/project/${this.historyId}/blob/${blobHash}`,
|
||||||
|
})
|
||||||
|
expect(response.statusCode).to.equal(200)
|
||||||
|
expect(body).to.equal(blobContent)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user