File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,10 @@ import {
1111 setErrorCacheHeaders ,
1212} from "../src/common/cache.js" ;
1313import { guardAccess } from "../src/common/access.js" ;
14- import { retrieveSecondaryMessage } from "../src/common/error.js" ;
14+ import {
15+ MissingParamError ,
16+ retrieveSecondaryMessage ,
17+ } from "../src/common/error.js" ;
1518
1619// @ts -ignore
1720export default async ( req , res ) => {
@@ -102,6 +105,7 @@ export default async (req, res) => {
102105 bg_color,
103106 border_color,
104107 theme,
108+ show_repo_link : ! ( err instanceof MissingParamError ) ,
105109 } ,
106110 } ) ,
107111 ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ import {
88 setCacheHeaders ,
99 setErrorCacheHeaders ,
1010} from "../src/common/cache.js" ;
11- import { retrieveSecondaryMessage } from "../src/common/error.js" ;
11+ import {
12+ MissingParamError ,
13+ retrieveSecondaryMessage ,
14+ } from "../src/common/error.js" ;
1215import { parseArray , parseBoolean , renderError } from "../src/common/utils.js" ;
1316import { fetchStats } from "../src/fetchers/stats.js" ;
1417import { isLocaleAvailable } from "../src/translations.js" ;
@@ -140,6 +143,7 @@ export default async (req, res) => {
140143 bg_color,
141144 border_color,
142145 theme,
146+ show_repo_link : ! ( err instanceof MissingParamError ) ,
143147 } ,
144148 } ) ,
145149 ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ import {
88 setCacheHeaders ,
99 setErrorCacheHeaders ,
1010} from "../src/common/cache.js" ;
11- import { retrieveSecondaryMessage } from "../src/common/error.js" ;
11+ import {
12+ MissingParamError ,
13+ retrieveSecondaryMessage ,
14+ } from "../src/common/error.js" ;
1215import { parseBoolean , renderError } from "../src/common/utils.js" ;
1316import { fetchRepo } from "../src/fetchers/repo.js" ;
1417import { isLocaleAvailable } from "../src/translations.js" ;
@@ -105,6 +108,7 @@ export default async (req, res) => {
105108 bg_color,
106109 border_color,
107110 theme,
111+ show_repo_link : ! ( err instanceof MissingParamError ) ,
108112 } ,
109113 } ) ,
110114 ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ import {
88 setCacheHeaders ,
99 setErrorCacheHeaders ,
1010} from "../src/common/cache.js" ;
11- import { retrieveSecondaryMessage } from "../src/common/error.js" ;
11+ import {
12+ MissingParamError ,
13+ retrieveSecondaryMessage ,
14+ } from "../src/common/error.js" ;
1215import { parseArray , parseBoolean , renderError } from "../src/common/utils.js" ;
1316import { fetchTopLanguages } from "../src/fetchers/top-languages.js" ;
1417import { isLocaleAvailable } from "../src/translations.js" ;
@@ -163,6 +166,7 @@ export default async (req, res) => {
163166 bg_color,
164167 border_color,
165168 theme,
169+ show_repo_link : ! ( err instanceof MissingParamError ) ,
166170 } ,
167171 } ) ,
168172 ) ;
Original file line number Diff line number Diff line change @@ -11,7 +11,10 @@ import {
1111 setErrorCacheHeaders ,
1212} from "../src/common/cache.js" ;
1313import { guardAccess } from "../src/common/access.js" ;
14- import { retrieveSecondaryMessage } from "../src/common/error.js" ;
14+ import {
15+ MissingParamError ,
16+ retrieveSecondaryMessage ,
17+ } from "../src/common/error.js" ;
1518
1619// @ts -ignore
1720export default async ( req , res ) => {
@@ -121,6 +124,7 @@ export default async (req, res) => {
121124 bg_color,
122125 border_color,
123126 theme,
127+ show_repo_link : ! ( err instanceof MissingParamError ) ,
124128 } ,
125129 } ) ,
126130 ) ;
Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ describe("Test /api/gist", () => {
129129 renderError ( {
130130 message : 'Missing params "id" make sure you pass the parameters in URL' ,
131131 secondaryMessage : "/api/gist?id=GIST_ID" ,
132+ renderOptions : { show_repo_link : false } ,
132133 } ) ,
133134 ) ;
134135 } ) ;
Original file line number Diff line number Diff line change @@ -212,6 +212,7 @@ describe("Test /api/pin", () => {
212212 message :
213213 'Missing params "username", "repo" make sure you pass the parameters in URL' ,
214214 secondaryMessage : "/api/pin?username=USERNAME&repo=REPO_NAME" ,
215+ renderOptions : { show_repo_link : false } ,
215216 } ) ,
216217 ) ;
217218 } ) ;
You can’t perform that action at this time.
0 commit comments