mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-25 17:44:14 -05:00
06b68490d1
* Enable ESLint recommended ruleset * Disable failing ESLint recommended rules * Remove rules shadowed by eslint:recommended
38 lines
952 B
JavaScript
38 lines
952 B
JavaScript
import api from '../api';
|
|
|
|
export const ACCOUNT_NOTE_SUBMIT_REQUEST = 'ACCOUNT_NOTE_SUBMIT_REQUEST';
|
|
export const ACCOUNT_NOTE_SUBMIT_SUCCESS = 'ACCOUNT_NOTE_SUBMIT_SUCCESS';
|
|
export const ACCOUNT_NOTE_SUBMIT_FAIL = 'ACCOUNT_NOTE_SUBMIT_FAIL';
|
|
|
|
export function submitAccountNote(id, value) {
|
|
return (dispatch, getState) => {
|
|
dispatch(submitAccountNoteRequest());
|
|
|
|
api(getState).post(`/api/v1/accounts/${id}/note`, {
|
|
comment: value,
|
|
}).then(response => {
|
|
dispatch(submitAccountNoteSuccess(response.data));
|
|
}).catch(error => dispatch(submitAccountNoteFail(error)));
|
|
};
|
|
}
|
|
|
|
export function submitAccountNoteRequest() {
|
|
return {
|
|
type: ACCOUNT_NOTE_SUBMIT_REQUEST,
|
|
};
|
|
}
|
|
|
|
export function submitAccountNoteSuccess(relationship) {
|
|
return {
|
|
type: ACCOUNT_NOTE_SUBMIT_SUCCESS,
|
|
relationship,
|
|
};
|
|
}
|
|
|
|
export function submitAccountNoteFail(error) {
|
|
return {
|
|
type: ACCOUNT_NOTE_SUBMIT_FAIL,
|
|
error,
|
|
};
|
|
}
|