Skip to content

Commit

Permalink
Merge pull request #96 from Chia-Network/develop
Browse files Browse the repository at this point in the history
Release 1.7.9
  • Loading branch information
TheLastCicada authored Apr 9, 2024
2 parents 461ea1f + 1ca88cb commit f8e77ed
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "core-registry-cadt",
"version": "1.7.8",
"version": "1.7.9",
"_comment": "DONT CHANGE MAJOR UNLESS DATAMODEL CHANGES: The major version corresponds to the datamodel version your using, so 2.0.0 means it'll use datamodel v2",
"private": true,
"bin": "build/server.js",
Expand Down
5 changes: 4 additions & 1 deletion src/controllers/units.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ export const findAll = async (req, res) => {
}

where.marketplace = {
[Sequelize.Op.not]: 'Tokenized on Chia',
[Sequelize.Op.or]: [
{ [Sequelize.Op.is]: null },
{ [Sequelize.Op.not]: 'Tokenized on Chia' },
],
};
}

Expand Down
8 changes: 7 additions & 1 deletion src/validations/projects.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const baseSchema = {
export const projectsGetQuerySchema = Joi.object()
.keys({
page: Joi.number().min(1),
limit: Joi.number().max(100).min(1),
limit: Joi.number().max(1000).min(1),
search: Joi.string(),
columns: Joi.array().items(Joi.string()).single(),
orgUid: Joi.string(),
Expand All @@ -74,6 +74,12 @@ export const projectsGetQuerySchema = Joi.object()
filter: Joi.string().regex(genericFilterRegex).max(100).min(1),
onlyMarketplaceProjects: Joi.boolean(),
})
.when(Joi.object({ xls: Joi.exist() }).unknown(), {
then: Joi.object({
page: Joi.number().min(1).optional(),
limit: Joi.number().max(100).min(1).optional(),
}),
})
.with('page', 'limit')
.with('limit', 'page');

Expand Down
8 changes: 7 additions & 1 deletion src/validations/units.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const unitsPostSchema = Joi.object({

export const unitsGetQuerySchema = Joi.object({
page: Joi.number().min(1).required(),
limit: Joi.number().max(100).min(1).required(),
limit: Joi.number().max(1000).min(1).required(),
search: Joi.string(),
warehouseUnitId: Joi.string(),
columns: Joi.array().items(Joi.string()).single(),
Expand Down Expand Up @@ -81,6 +81,12 @@ export const unitsGetQuerySchema = Joi.object({
limit: Joi.number().max(100).min(1).optional(),
}),
})
.when(Joi.object({ xls: Joi.exist() }).unknown(), {
then: Joi.object({
page: Joi.number().min(1).optional(),
limit: Joi.number().max(100).min(1).optional(),
}),
})
.and('page', 'limit');

export const unitsUpdateSchema = Joi.object({
Expand Down

0 comments on commit f8e77ed

Please sign in to comment.