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:
Simon Detheridge 2018-12-19 15:52:44 +00:00 committed by sharelatex
parent d2465f8d6a
commit 531f5fb6ee

View file

@ -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) ->