mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #1280 from sharelatex/spd-open-in-overleaf-conversions
open-in-overleaf: Add support for partner and client_media_id parameters GitOrigin-RevId: a4c18a03affa62a1ef2cfb0c595766724ba8969b
This commit is contained in:
parent
d2465f8d6a
commit
531f5fb6ee
1 changed files with 10 additions and 0 deletions
|
@ -38,6 +38,8 @@ module.exports = MockV1Api =
|
|||
|
||||
brands: {}
|
||||
|
||||
validation_clients: {}
|
||||
|
||||
setAffiliations: (affiliations) -> @affiliations = affiliations
|
||||
|
||||
run: () ->
|
||||
|
@ -126,6 +128,14 @@ module.exports = MockV1Api =
|
|||
valid: false
|
||||
}
|
||||
|
||||
app.get "/api/v2/partners/:partner/conversions/:id", (req, res, next) =>
|
||||
partner = @validation_clients[req.params.partner]
|
||||
conversion = partner?.conversions?[req.params.id]
|
||||
if conversion?
|
||||
res.status(200).json {input_file_uri: conversion, brand_variation_id: partner.brand_variation_id}
|
||||
else
|
||||
res.status(404).json {}
|
||||
|
||||
app.listen 5000, (error) ->
|
||||
throw error if error?
|
||||
.on "error", (error) ->
|
||||
|
|
Loading…
Reference in a new issue