Skip to content

Commit

Permalink
Message: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SiddheshKukade committed Oct 26, 2023
1 parent 6b79112 commit 51841bd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@ import React, { useState } from 'react';
import PropTypes from 'prop-types';
import styles from './AdvertisementEntry.module.css';
import { Button, Card, Col, Row, Spinner } from 'react-bootstrap';
import {
DELETE_ADVERTISEMENT_BY_ID,
UPDATE_INSTALL_STATUS_PLUGIN_MUTATION,
} from 'GraphQl/Mutations/mutations';
import { DELETE_ADVERTISEMENT_BY_ID } from 'GraphQl/Mutations/mutations';
import { useMutation } from '@apollo/client';
import { useTranslation } from 'react-i18next';
import { toast } from 'react-toastify';

interface InterfaceAddOnEntryProps {
id: string;
name: string;
Expand All @@ -18,25 +13,20 @@ interface InterfaceAddOnEntryProps {
orgId: string;
startDate: Date;
endDate: Date;
// getInstalledPlugins: () => any;
}
function advertisementEntry({
id,
name,
type,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
orgId,
link,
endDate,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
startDate,
}: InterfaceAddOnEntryProps): JSX.Element {
const { t } = useTranslation('translation', { keyPrefix: 'advertisement' });
//getting orgId from URL
const currentOrg = window.location.href.split('/id=')[1] + '';
const [buttonLoading, setButtonLoading] = useState(false);
// const [addOrgAsUninstalled] = useMutation(UPDATE_ORG_STATUS_PLUGIN_MUTATION);
const [addOrgAsUninstalled] = useMutation(
UPDATE_INSTALL_STATUS_PLUGIN_MUTATION
);
const [deleteAdById] = useMutation(DELETE_ADVERTISEMENT_BY_ID);

const onDelete = async (): Promise<void> => {
Expand Down Expand Up @@ -76,7 +66,6 @@ function advertisementEntry({
data-testid="AddOnEntry_btn_install"
onClick={(): void => {
onDelete();
// getInstalledPlugins();
}}
>
{buttonLoading ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ interface InterfaceFormStateTypes {
endDate: Date;
orgId: string;
}

const currentUrl = window.location.href.split('=')[1];
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function advertisementRegister({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
createdBy,
}: InterfaceAddOnRegisterProps): JSX.Element {
const { t } = useTranslation('translation', { keyPrefix: 'advertisement' });
Expand Down
8 changes: 0 additions & 8 deletions src/components/UserPortal/PromotedPost/PromotedPost.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React from 'react';
import { Card } from 'react-bootstrap';
import AccountCircleIcon from '@mui/icons-material/AccountCircle';
import styles from './PromotedPost.module.css';
import { toast } from 'react-toastify';
import { useTranslation } from 'react-i18next';
import StarPurple500Icon from '@mui/icons-material/StarPurple500';
interface InterfacePostCardProps {
id: string;
Expand All @@ -13,11 +10,6 @@ interface InterfacePostCardProps {
export default function promotedPost(
props: InterfacePostCardProps
): JSX.Element {
const { t } = useTranslation('translation', {
keyPrefix: 'postCard',
});

const userId = localStorage.getItem('userId');
return (
<>
<Card className="my-3">
Expand Down
12 changes: 3 additions & 9 deletions src/screens/UserPortal/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,11 @@ export default function home(): JSX.Element {
};
const {
data: promotedPostsData,
refetch: promotedPostsRefetch,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
refetch: _promotedPostsRefetch,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
loading: promotedPostsLoading,
} = useQuery(ADVERTISEMENTS_GET);
console.log(
currentOrgId,
promotedPostsData,
adContent.filter((ad: any) => ad.orgId == currentOrgId),
adContent
.filter((ad: any) => ad.orgId == currentOrgId)
.filter((ad: any) => new Date(ad.endDate) > new Date())
);
const {
data,
refetch,
Expand Down

0 comments on commit 51841bd

Please sign in to comment.