mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-03 22:31:52 +00:00
When handling API errors, use the type prop and fallback to error if not found
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
import qs from 'qs';
|
||||
import { isEmpty, isNil, reject } from 'ramda';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const API_VERSION = '1';
|
||||
|
||||
export const apiErrorType = PropTypes.shape({
|
||||
type: PropTypes.string,
|
||||
detail: PropTypes.string,
|
||||
title: PropTypes.string,
|
||||
status: PropTypes.number,
|
||||
error: PropTypes.string, // Deprecated
|
||||
message: PropTypes.string, // Deprecated
|
||||
});
|
||||
|
||||
export const buildShlinkBaseUrl = (url) => url ? `${url}/rest/v${API_VERSION}` : '';
|
||||
|
||||
export default class ShlinkApiClient {
|
||||
|
||||
Reference in New Issue
Block a user