require exampleUrl and urlPattern if using staticExample (#2132)
This commit is contained in:
@@ -127,6 +127,12 @@ class BaseService {
|
|||||||
} is missing required previewUrl or staticExample`
|
} is missing required previewUrl or staticExample`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (staticExample && !urlPattern) {
|
||||||
|
throw new Error('Must declare a urlPattern if using staticExample')
|
||||||
|
}
|
||||||
|
if (staticExample && !exampleUrl) {
|
||||||
|
throw new Error('Must declare an exampleUrl if using staticExample')
|
||||||
|
}
|
||||||
|
|
||||||
const stringified = queryString.stringify(query)
|
const stringified = queryString.stringify(query)
|
||||||
const suffix = stringified ? `?${stringified}` : ''
|
const suffix = stringified ? `?${stringified}` : ''
|
||||||
|
|||||||
Reference in New Issue
Block a user