Skip to content

Commit c21dca6

Browse files
committed
assignment 5
1 parent c25f29c commit c21dca6

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/components/ParagraphWidget/ParagraphWidget.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class ParagraphWidget extends React.Component {
3434

3535
}
3636
render(){
37+
console.log(this.props.widget.name,this.props.widget.order, this.props.lastIndex)
3738
return(<div className="paragraph-container">
3839
<div className="paragraph-menu d-flex mb-2">
3940
<h3>Paragraph widget</h3>

src/reducers/moduleReducer.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const initialState = {
1010
}
1111

1212
const moduleReducer = (state=initialState, action) => {
13+
1314
switch (action.type) {
1415
case FIND_MODULES_FOR_COURSE:
1516
return {
@@ -27,15 +28,15 @@ const moduleReducer = (state=initialState, action) => {
2728

2829
return {
2930
...state,
30-
modules: [
31-
...state.modules,
32-
action.module]
31+
modules: [...state.modules,
32+
action.module]
3333
}
3434
case DELETE_MODULE:
3535
return {
3636
...state,
3737
modules: state.modules.filter(module => action.id !== module._id)
3838
}
39+
3940
case UPDATE_MODULE:
4041
return {
4142
...state,
@@ -47,6 +48,8 @@ const moduleReducer = (state=initialState, action) => {
4748
default:
4849
return state
4950
}
51+
52+
5053
}
5154

5255
export default moduleReducer

src/services/WidgetService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const widgetUrl = "http://localhost:8080/api/widgets"
2-
const topicsUrl = "http://localhost:8080/api/topics"
1+
const widgetUrl = "https://afternoon-earth-72200.herokuapp.com/api/widgets"
2+
const topicsUrl = "https://afternoon-earth-72200.herokuapp.com/api/topics"
33

44
export const findWidgetsForTopic = (topicId) =>
55
fetch(`${topicsUrl}/${topicId}/widgets`)

0 commit comments

Comments
 (0)