闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.1 KiB

  1. import api from '../api';
  2. export const IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST = 'IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST';
  3. export const IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS = 'IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS';
  4. export const IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL = 'IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL';
  5. export const fetchAccountIdentityProofs = accountId => (dispatch, getState) => {
  6. dispatch(fetchAccountIdentityProofsRequest(accountId));
  7. api(getState).get(`/api/v1/accounts/${accountId}/identity_proofs`)
  8. .then(({ data }) => dispatch(fetchAccountIdentityProofsSuccess(accountId, data)))
  9. .catch(err => dispatch(fetchAccountIdentityProofsFail(accountId, err)));
  10. };
  11. export const fetchAccountIdentityProofsRequest = id => ({
  12. type: IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST,
  13. id,
  14. });
  15. export const fetchAccountIdentityProofsSuccess = (accountId, identity_proofs) => ({
  16. type: IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS,
  17. accountId,
  18. identity_proofs,
  19. });
  20. export const fetchAccountIdentityProofsFail = (accountId, err) => ({
  21. type: IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL,
  22. accountId,
  23. err,
  24. skipNotFound: true,
  25. });