chore: update services with publicRuntimeConfig

This commit is contained in:
Henit Chobisa 2023-09-06 06:25:47 +00:00
parent 928ae775f4
commit a718056b93
23 changed files with 46 additions and 23 deletions

View File

@ -1,11 +1,12 @@
// services // services
import getConfig from "next/config";
import APIService from "services/api.service"; import APIService from "services/api.service";
import trackEventServices from "services/track-event.service"; import trackEventServices from "services/track-event.service";
// types // types
import { ICurrentUserResponse, IGptResponse } from "types"; import { ICurrentUserResponse, IGptResponse } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -9,7 +9,8 @@ import {
ISaveAnalyticsFormData, ISaveAnalyticsFormData,
} from "types"; } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
class AnalyticsServices extends APIService { class AnalyticsServices extends APIService {
constructor() { constructor() {

View File

@ -2,7 +2,8 @@
import axios from "axios"; import axios from "axios";
import APIService from "services/api.service"; import APIService from "services/api.service";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
class AppInstallationsService extends APIService { class AppInstallationsService extends APIService {
constructor() { constructor() {

View File

@ -2,7 +2,8 @@
import APIService from "services/api.service"; import APIService from "services/api.service";
import { ICurrentUserResponse } from "types"; import { ICurrentUserResponse } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
class AuthService extends APIService { class AuthService extends APIService {
constructor() { constructor() {

View File

@ -5,7 +5,8 @@ import trackEventServices from "services/track-event.service";
// types // types
import type { CycleDateCheckData, ICurrentUserResponse, ICycle, IIssue } from "types"; import type { CycleDateCheckData, ICurrentUserResponse, ICycle, IIssue } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -4,7 +4,8 @@ import APIService from "services/api.service";
import type { ICurrentUserResponse, IEstimate, IEstimateFormData } from "types"; import type { ICurrentUserResponse, IEstimate, IEstimateFormData } from "types";
import trackEventServices from "services/track-event.service"; import trackEventServices from "services/track-event.service";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -1,7 +1,8 @@
// services // services
import APIService from "services/api.service"; import APIService from "services/api.service";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
interface UnSplashImage { interface UnSplashImage {
id: string; id: string;

View File

@ -1,7 +1,8 @@
import APIService from "services/api.service"; import APIService from "services/api.service";
import trackEventServices from "services/track-event.service"; import trackEventServices from "services/track-event.service";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -3,7 +3,8 @@ import trackEventServices from "services/track-event.service";
import { ICurrentUserResponse } from "types"; import { ICurrentUserResponse } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -3,7 +3,8 @@ import trackEventServices from "services/track-event.service";
import { ICurrentUserResponse, IGithubRepoInfo, IGithubServiceImportFormData } from "types"; import { ICurrentUserResponse, IGithubRepoInfo, IGithubServiceImportFormData } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -10,7 +10,8 @@ import {
IExportServiceResponse, IExportServiceResponse,
} from "types"; } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -4,7 +4,8 @@ import trackEventServices from "services/track-event.service";
// types // types
import { IJiraMetadata, IJiraResponse, IJiraImporterForm, ICurrentUserResponse } from "types"; import { IJiraMetadata, IJiraResponse, IJiraImporterForm, ICurrentUserResponse } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -12,7 +12,8 @@ import type {
ISubIssueResponse, ISubIssueResponse,
} from "types"; } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -5,7 +5,8 @@ import trackEventServices from "./track-event.service";
// types // types
import type { IIssueViewOptions, IModule, IIssue, ICurrentUserResponse } from "types"; import type { IIssueViewOptions, IModule, IIssue, ICurrentUserResponse } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -1,7 +1,8 @@
// services // services
import APIService from "services/api.service"; import APIService from "services/api.service";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
// types // types
import type { import type {

View File

@ -5,7 +5,8 @@ import trackEventServices from "services/track-event.service";
// types // types
import { IPage, IPageBlock, RecentPagesResponse, IIssue, ICurrentUserResponse } from "types"; import { IPage, IPageBlock, RecentPagesResponse, IIssue, ICurrentUserResponse } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -5,7 +5,8 @@ import trackEventServices from "services/track-event.service";
import { ICurrentUserResponse } from "types"; import { ICurrentUserResponse } from "types";
import { IProjectPublishSettings } from "store/project-publish"; import { IProjectPublishSettings } from "store/project-publish";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -16,7 +16,8 @@ import type {
TProjectIssuesSearchParams, TProjectIssuesSearchParams,
} from "types"; } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -11,7 +11,8 @@ import type {
IssueCommentReactionForm, IssueCommentReactionForm,
} from "types"; } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -2,7 +2,8 @@
import APIService from "services/api.service"; import APIService from "services/api.service";
import trackEventServices from "services/track-event.service"; import trackEventServices from "services/track-event.service";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -12,7 +12,8 @@ import type {
IUserWorkspaceDashboard, IUserWorkspaceDashboard,
} from "types"; } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -6,7 +6,8 @@ import { ICurrentUserResponse } from "types";
// types // types
import { IView } from "types/views"; import { IView } from "types/views";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
const trackEvent = const trackEvent =
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1"; process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";

View File

@ -2,7 +2,8 @@
import APIService from "services/api.service"; import APIService from "services/api.service";
import trackEventServices from "services/track-event.service"; import trackEventServices from "services/track-event.service";
const { NEXT_PUBLIC_API_BASE_URL } = process.env; import getConfig from "next/config";
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
// types // types
import { import {