-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alexandre Esteves <[email protected]>
- Loading branch information
1 parent
4d1c16f
commit 50d6471
Showing
11 changed files
with
292 additions
and
116 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
interface CategoryApiData { | ||
slug: string | ||
name: string | ||
url: string | ||
} | ||
|
||
interface CategoryProps { | ||
slug: string | ||
name: string | ||
url: string | ||
} | ||
|
||
class Category { | ||
slug: string | ||
name: string | ||
url: string | ||
|
||
constructor(props: CategoryProps) { | ||
this.slug = props.slug | ||
this.name = props.name | ||
this.url = props.url | ||
} | ||
|
||
static fromApi(props: CategoryApiData): Category { | ||
return new Category({ | ||
name: props.name, | ||
slug: props.slug, | ||
url: props.url, | ||
}) | ||
} | ||
|
||
toApi(): Omit<CategoryApiData, 'id'> { | ||
return { | ||
name: this.name, | ||
slug: this.slug, | ||
url: this.url, | ||
} | ||
} | ||
} | ||
|
||
export { | ||
type CategoryApiData, | ||
type CategoryProps, | ||
Category, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 50 additions & 5 deletions
55
src/app/page/products/components/form-product/form-product.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,8 @@ | |
align-self: end; | ||
gap: 10px; | ||
} | ||
|
||
&__stock { | ||
justify-content: start; | ||
} | ||
} |
Oops, something went wrong.