Skip to content

Commit

Permalink
Fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
georgipavlov-7DIGIT committed Jul 11, 2023
1 parent d2649aa commit 78f11e2
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 17 deletions.
16 changes: 11 additions & 5 deletions src/api/apiHandlers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-empty-pattern */
const API_URL = "http://localhost:80/api/v1"; // Replace with env variable

const defaultOptions = ({ headers, options }) => ({
Expand All @@ -18,7 +19,7 @@ export const apiGet = async ({ path, headers: {}, options: {} }) => {
return res;
})
.catch((err) => {
// If this fails you need to handle it
console.log(err);
});
};

Expand All @@ -40,7 +41,7 @@ export const apiPost = async ({ path, body: {}, headers: {}, options: {} }) => {
return res;
})
.catch((err) => {
// If this fails you need to handle it
console.log(err);
});
};

Expand All @@ -62,11 +63,16 @@ export const apiPut = async ({ path, body: {}, headers: {}, options: {} }) => {
return res;
})
.catch((err) => {
// If this fails you need to handle it
console.log(err);
});
};

export const apiDelete = async ({ path, body: {}, headers: {}, options: {} }) => {
export const apiDelete = async ({
path,
body: {},
headers: {},
options: {},
}) => {
const reqOptions = defaultOptions({
headers,

Check failure on line 77 in src/api/apiHandlers.js

View workflow job for this annotation

GitHub Actions / ESLint

src/api/apiHandlers.js#L77

'headers' is not defined (no-undef)
options: {
Expand All @@ -84,6 +90,6 @@ export const apiDelete = async ({ path, body: {}, headers: {}, options: {} }) =>
return res;
})
.catch((err) => {
// If this fails you need to handle it
console.log(err);
});
};
2 changes: 1 addition & 1 deletion src/hooks/useExample.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import { useState } from "react";
import { useQuery } from "@tanstack/react-query";

export default function useExample() {
Expand Down
1 change: 0 additions & 1 deletion src/hooks/useGetCampaigns.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useQuery } from "@tanstack/react-query";
import { providerSvc } from "@USupport-components-library/services";
import { getDateView } from "@USupport-components-library/utils";

export function useGetCampaigns(enabled = true) {
const getCampaigns = async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useGetConsultationData.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function useGetConsultationData(consultationId) {
},
],
};
const getConsultationData = async (consultationId) => {
const getConsultationData = async () => {
await new Promise((resolve) => setTimeout(resolve, 2500));
return placeholderData;
};
Expand Down
5 changes: 1 addition & 4 deletions src/hooks/useGetConsultationsForCampaign.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { useQuery } from "@tanstack/react-query";
import { providerSvc } from "@USupport-components-library/services";
import { ONE_HOUR } from "../../USupport-components-library/src/utils";

export default function useGetConsultationsForCampaign(
campaignId,
enabled = true
) {
export default function useGetConsultationsForCampaign(campaignId) {
const getConsultationsForCampaign = async () => {
const response = await providerSvc.getConsultationsForCampaign(campaignId);

Expand Down
1 change: 0 additions & 1 deletion src/hooks/useUpdateProviderData.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { useState } from "react";
import { providerSvc } from "@USupport-components-library/services";
import { useError } from "./useError";

Expand Down
4 changes: 0 additions & 4 deletions src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,7 @@ const resources = {
"consultation-page": ConsultationPage.ru,
"reports-page": ReportsPage.ru,
"add-campaign-availability-page": AddCampaignAvailabilityPage.ru,
"reports-page": ReportsPage.ru,
"campaigns-page": CampaignsPage.ru,
"add-campaign-availability-page": AddCampaignAvailabilityPage.ru,
"customers-qa-page": CustomersQAPage.ru,
"consultations-page": ConsultationsPage.ru,
"notifications-page": NotificationsPage.ru,
Expand Down Expand Up @@ -268,9 +266,7 @@ const resources = {
"consultation-page": ConsultationPage.kk,
"reports-page": ReportsPage.kk,
"add-campaign-availability-page": AddCampaignAvailabilityPage.kk,
"reports-page": ReportsPage.kk,
"campaigns-page": CampaignsPage.kk,
"add-campaign-availability-page": AddCampaignAvailabilityPage.kk,
"customers-qa-page": CustomersQAPage.kk,
"consultations-page": ConsultationsPage.kk,
"notifications-page": NotificationsPage.kk,
Expand Down

0 comments on commit 78f11e2

Please sign in to comment.