fix [clojars] snapshot fallback (#3187)
* fix snapshot fallback * fix prettier formatting * update schema * chore: test schema tweak * fix schema * Add allow null on schema
This commit is contained in:
committed by
Caleb Cartwright
parent
2a9e1bbd83
commit
f4ad1aa6fc
@@ -7,8 +7,8 @@ const { BaseJsonService } = require('..')
|
||||
|
||||
const clojarsSchema = Joi.object({
|
||||
downloads: nonNegativeInteger,
|
||||
latest_release: Joi.string().allow(null),
|
||||
latest_version: Joi.string().required(),
|
||||
latest_release: Joi.string().required(),
|
||||
}).required()
|
||||
|
||||
class BaseClojarsService extends BaseJsonService {
|
||||
|
||||
@@ -5,7 +5,10 @@ const { BaseClojarsVersionService } = require('./clojars-base')
|
||||
module.exports = class ClojarsVersionRelease extends BaseClojarsVersionService {
|
||||
async handle({ clojar }) {
|
||||
const json = await this.fetch({ clojar })
|
||||
return this.constructor.render({ clojar, version: json.latest_release })
|
||||
return this.constructor.render({
|
||||
clojar,
|
||||
version: json.latest_release ? json.latest_release : json.latest_version,
|
||||
})
|
||||
}
|
||||
|
||||
static get route() {
|
||||
|
||||
Reference in New Issue
Block a user