-
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.
- Loading branch information
1 parent
e698c89
commit df9a440
Showing
29 changed files
with
569 additions
and
194 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1 +1 @@ | ||
API_URL = 'https://localhost:8000/api' | ||
API_URL = |
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
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,8 @@ | ||
export const PASSWORD_REGEX = { | ||
upperCase: new RegExp('.*[A-Z].*'), | ||
lowerCase: new RegExp('.*[a-z].*'), | ||
number: new RegExp('.*\\d.*'), | ||
specialCharacter: new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*') | ||
} | ||
|
||
export const PHONE_REGEX = new RegExp('^[+]?[(]?[0-9]{3}[)]?[-s.]?[0-9]{3}[-s.]?[0-9]{4,6}$') |
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,43 @@ | ||
import { PayloadAction, createSlice } from '@reduxjs/toolkit' | ||
|
||
//interface | ||
import { ICategory } from '@shared/interfaces/category/model' | ||
|
||
export const CategorySliceKey = 'category' | ||
|
||
type InitialType = { | ||
categories: ICategory[] | ||
} | ||
|
||
const initialState = { | ||
categories: [] | ||
} as InitialType | ||
|
||
const categorySlice = createSlice({ | ||
name: CategorySliceKey, | ||
initialState, | ||
reducers: { | ||
setCategories: (state, action: PayloadAction<ICategory[]>) => { | ||
state.categories = action.payload | ||
}, | ||
|
||
addCategories: (state, action: PayloadAction<ICategory>) => { | ||
state.categories.push(action.payload) | ||
}, | ||
|
||
updateCategories: (state, action: PayloadAction<ICategory>) => { | ||
state.categories = state.categories.filter((category) => | ||
category.id === action.payload.id ? action.payload : category | ||
) | ||
}, | ||
|
||
removeCategories: (state, action: PayloadAction<ICategory>) => { | ||
state.categories = state.categories.filter((category) => category.id !== action.payload.id) | ||
} | ||
} | ||
}) | ||
|
||
export const { setCategories } = categorySlice.actions | ||
|
||
const categoryReducer = categorySlice.reducer | ||
export default categoryReducer |
Oops, something went wrong.