Sfoglia il codice sorgente

Merge pull request #1375 from sharelatex/spd-open-in-overleaf-brand-variation-ids

open-in-overleaf: Add support for 'brand_variation_id' parameter
GitOrigin-RevId: 65c7732c3a3b85e524e9ac1ae6f13cd322ef8ccb
Simon Detheridge 7 anni fa
parent
commit
f49523f6bc

+ 9 - 0
services/web/test/acceptance/coffee/helpers/MockV1Api.coffee

@@ -38,6 +38,8 @@ module.exports = MockV1Api =
 
 
 	brands: {}
 	brands: {}
 
 
+	brand_variations: {}
+
 	validation_clients: {}
 	validation_clients: {}
 
 
 	setAffiliations: (affiliations) -> @affiliations = affiliations
 	setAffiliations: (affiliations) -> @affiliations = affiliations
@@ -140,6 +142,13 @@ module.exports = MockV1Api =
 			else
 			else
 				res.status(404).json {}
 				res.status(404).json {}
 
 
+		app.get "/api/v2/brand_variations/:id", (req, res, next) =>
+			variation = @brand_variations[req.params.id]
+			if variation?
+				res.status(200).json variation
+			else
+				res.status(404).json {}
+
 		app.get '/api/v1/sharelatex/docs/:token/is_published', (req, res, next) =>
 		app.get '/api/v1/sharelatex/docs/:token/is_published', (req, res, next) =>
 			res.json { allow: true }
 			res.json { allow: true }