fix merge conflict bugs
This commit is contained in:
parent
17836fcd88
commit
b94107c4b1
3 changed files with 2 additions and 65 deletions
|
@ -44,62 +44,3 @@ export function decreaseFont() {
|
||||||
type: ActionTypes.DECREASE_FONTSIZE
|
type: ActionTypes.DECREASE_FONTSIZE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function saveProject() {
|
|
||||||
return function(dispatch, getState) {
|
|
||||||
var state = getState();
|
|
||||||
var formParams = Object.assign({}, state.project);
|
|
||||||
formParams.file = state.file;
|
|
||||||
if (state.id) {
|
|
||||||
axios.put(`${ROOT_URL}/projects/${state.id}`, formParams, {withCredentials: true})
|
|
||||||
.then(response => {
|
|
||||||
dispatch({
|
|
||||||
type: ActionTYpes.PROJECT_SAVE_SUCCESS
|
|
||||||
})
|
|
||||||
.catch(response => dispatch({
|
|
||||||
type: ActionTypes.PROJECT_SAVE_FAIL
|
|
||||||
}));
|
|
||||||
})
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
axios.post(`${ROOT_URL}/projects`, formParams, {withCredentials: true})
|
|
||||||
.then(response => {
|
|
||||||
browserHistory.push('/' + response.data.id);
|
|
||||||
dispatch({
|
|
||||||
type: ActionTypes.NEW_PROJECT,
|
|
||||||
name: response.data.name,
|
|
||||||
id: response.data.id,
|
|
||||||
file: {
|
|
||||||
name: response.data.file.name,
|
|
||||||
content: response.data.file.content
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(response => dispatch({
|
|
||||||
type: ActionTypes.PROJECT_SAVE_FAIL
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export function createProject() {
|
|
||||||
return function(dispatch) {
|
|
||||||
axios.post(`${ROOT_URL}/projects`, {}, {withCredentials: true})
|
|
||||||
.then(response => {
|
|
||||||
dispatch({
|
|
||||||
type: ActionTypes.NEW_PROJECT,
|
|
||||||
name: response.data.name,
|
|
||||||
id: response.data.id,
|
|
||||||
file: {
|
|
||||||
name: response.data.file.name,
|
|
||||||
content: response.data.file.content
|
|
||||||
}
|
|
||||||
});
|
|
||||||
browserHistory.push('/' + response.data.id);
|
|
||||||
})
|
|
||||||
.catch(response => dispatch({
|
|
||||||
type: ActionTypes.PROJECT_SAVE_FAIL
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ export function saveProject() {
|
||||||
axios.put(`${ROOT_URL}/projects/${state.id}`, formParams, {withCredentials: true})
|
axios.put(`${ROOT_URL}/projects/${state.id}`, formParams, {withCredentials: true})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ActionTYpes.PROJECT_SAVE_SUCCESS
|
type: ActionTypes.PROJECT_SAVE_SUCCESS
|
||||||
})
|
})
|
||||||
.catch(response => dispatch({
|
.catch(response => dispatch({
|
||||||
type: ActionTypes.PROJECT_SAVE_FAIL
|
type: ActionTypes.PROJECT_SAVE_FAIL
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%button {
|
%toolbar-button {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: #{44 / $base-font-size}rem;
|
height: #{44 / $base-font-size}rem;
|
||||||
width: #{44 / $base-font-size}rem;
|
width: #{44 / $base-font-size}rem;
|
||||||
|
@ -8,10 +8,6 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: none;
|
border: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
|
||||||
|
|
||||||
%toolbar-button {
|
|
||||||
@extend %button;
|
|
||||||
background-color: $light-button-background-color;
|
background-color: $light-button-background-color;
|
||||||
color: $light-button-color;
|
color: $light-button-color;
|
||||||
& g {
|
& g {
|
||||||
|
|
Loading…
Reference in a new issue