Skip to content

Commit

Permalink
fix(products): isNumber validator causing error (#26)
Browse files Browse the repository at this point in the history
* fix(auth): added sameSite attribute

* chore(release): 0.0.5

* chore(release): 0.0.6

* fix(products): isNumber validator causing error

* chore(release): 0.0.7
  • Loading branch information
KostaD02 authored Sep 12, 2023
1 parent d1ef296 commit 6ea7307
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.0.7](https://github.com/educata/everrest/compare/v0.0.6...v0.0.7) (2023-09-12)


### Bug Fixes

* **products:** isNumber validator causing error ([fa9f2aa](https://github.com/educata/everrest/commit/fa9f2aa0bb9ac5f045f1c097df8d85d9ed99cf83))

### 0.0.6 (2023-09-12)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "everrest",
"version": "0.0.6",
"version": "0.0.7",
"description": "",
"author": "",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/shop/dtos/create-product.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class CreateProductDto {
@Type(() => ProductCategoryDto)
category: ProductCategory;

@IsNumber(null, { message: ProductExceptionKeys.WarrantyMustBeNumber })
@IsNumber({}, { message: ProductExceptionKeys.WarrantyMustBeNumber })
@IsPositive({ message: ProductExceptionKeys.InvalidWarranty })
warranty: number;

Expand Down
2 changes: 0 additions & 2 deletions src/modules/shop/dtos/product-category.dto.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { IsString, IsUrl } from 'class-validator';
import { ProductExceptionKeys } from 'src/enums';
import { ProductCategory } from 'src/interfaces';
import { MongooseId } from 'src/shared';

export class ProductCategoryDto implements ProductCategory {
@IsString()
@MongooseId()
id: string;

@IsString({ message: ProductExceptionKeys.InvalidCategoryName })
Expand Down
3 changes: 2 additions & 1 deletion tools/product-builder/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ productForm.addEventListener('submit', function (event) {
images.push(image.value);
}
});
localStorage.setItem('data', JSON.stringify(data));
const data = {
title: formData.get('title'),
description: formData.get('title'),
Expand All @@ -60,7 +61,7 @@ productForm.addEventListener('submit', function (event) {
},
images,
};
console.log(data);
sendRequest('POST', `${baseURL}/shop/products`, data);
});

imageAddBtn.addEventListener('click', () => {
Expand Down

0 comments on commit 6ea7307

Please sign in to comment.