Skip to content

Commit 7c763a3

Browse files
committed
chore: cactus branche merged
2 parents 03e0ac1 + 3a5cd5e commit 7c763a3

File tree

15 files changed

+336
-70
lines changed

15 files changed

+336
-70
lines changed

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@
7272
"husky": "^8.0.3",
7373
"prettier": "^3.0.3",
7474
"sass": "^1.68.0",
75-
"typescript": "^5.2.2"
75+
"typescript": "^4.9.5"
7676
}
7777
}

src/app/api/organization.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ export interface AllOrgs{
1515
}[]
1616
}
1717

18+
19+
20+
1821
export const deleteOrg = async (
1922
authorizationToken: string,
2023
orgName: string

src/app/assets/images/github.png

778 Bytes
Loading

src/app/assets/images/login2.png

865 KB
Loading
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Dispatch } from "redux"
2+
import { Organization } from "../reducers/orgReducers"
3+
4+
5+
6+
7+
8+
9+
export const AddOrganization= (org:Organization)=>{
10+
return(dispatch:Dispatch)=>{
11+
dispatch({ type:'add',
12+
payload:org})
13+
}
14+
}
15+
16+
export const DeleteOrg=(org:Organization)=>{
17+
return(dispatch:Dispatch)=>{
18+
dispatch({
19+
type:'delete',
20+
payload:org
21+
})
22+
}
23+
}

src/app/state/action-creators/usersActions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ export const setAllUsernames = (usernames: string[]) => {
1818
};
1919
};
2020

21+
22+
23+

src/app/state/reducers/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import { combineReducers } from 'redux';
22
import { setAllUsernamesReducer, setUsernameReducer } from './usersReducers';
33
import timeRangeReducer from 'app/components/timeRangeSwitch/timeRangeSlice';
44
import searchReducer from 'features/home/slices/projectSearchSlice';
5+
import { orgReducer } from './orgReducers';
56

6-
const reducers = combineReducers({
7+
export const reducers = combineReducers({
78
isWeekly: timeRangeReducer,
89
searchKeyword: searchReducer,
910
setUsername: setUsernameReducer,
1011
setAllUsernames: setAllUsernamesReducer,
12+
organization: orgReducer
1113
});
1214

13-
export default reducers;
15+
export type RootState= ReturnType<typeof reducers>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { act } from "react-dom/test-utils"
2+
3+
export interface Organization{
4+
name: string,
5+
description: string|null
6+
7+
}
8+
9+
10+
export const orgReducer=(state: Organization[]=[], action:{
11+
type:string,
12+
payload: Organization
13+
})=>{
14+
15+
switch(action.type){
16+
case 'add':
17+
return state.concat(action.payload)
18+
19+
case 'delete':
20+
return state.filter(elem=>elem!=action.payload)
21+
22+
default:
23+
return state
24+
}
25+
26+
}
27+
28+
29+

src/app/state/store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { legacy_createStore as createStore } from 'redux';
22

3-
import reducers from './reducers';
3+
import {reducers} from './reducers';
44

55
const store = createStore(reducers, {});
66

0 commit comments

Comments
 (0)