Skip to content

Commit

Permalink
fix: eslint issues and updated wednesday logo
Browse files Browse the repository at this point in the history
  • Loading branch information
Shamoil authored and Shamoil committed Sep 4, 2024
1 parent 3fa1c6c commit 5d92faa
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
Binary file added app/assets/images/wednesday-logo-old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/wednesday-logo.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions app/assets/images/wednesday-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 13 additions & 4 deletions app/utils/apiUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import camelCase from 'lodash/camelCase';
import snakeCase from 'lodash/snakeCase';
import { Config } from '@app/config/index';
import get from 'lodash/get';
import { set } from 'lodash';

export const apiClients = {
configApi: null,
Expand All @@ -18,10 +19,11 @@ export const getApiClient = (type = 'configApi') =>
export const generateApiClient = (type = 'configApi') => {
switch (type) {
case 'configApi':
apiClients[type] = createApiClientWithTransForm(Config.API_URL);
set(apiClients, type, createApiClientWithTransForm(Config.API_URL));

return get(apiClients, type);
default:
apiClients.default = createApiClientWithTransForm(Config.API_URL);
set(apiClients, 'default', createApiClientWithTransForm(Config.API_URL));
return apiClients.default;
}
};
Expand All @@ -38,7 +40,13 @@ export const createApiClientWithTransForm = baseURL => {
response => {
const { data } = response;
if (data) {
response.data = mapKeysDeep(data, keys => camelCase(keys));
const keysData = mapKeysDeep(data, keys => camelCase(keys));
return {
ok: true,
data: keysData,
error: null,
originalResponse: response
};
}
return {
ok: true,
Expand All @@ -59,7 +67,8 @@ export const createApiClientWithTransForm = baseURL => {
api.interceptors.request.use(request => {
const { data } = request;
if (data) {
request.data = mapKeysDeep(data, keys => snakeCase(keys));
const keysData = mapKeysDeep(data, keys => snakeCase(keys));
return { ...request, data: keysData };
}
return request;
});
Expand Down

0 comments on commit 5d92faa

Please sign in to comment.