Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Macludde committed Aug 31, 2023
1 parent b001f92 commit e32fad5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion backend/services/core/src/datasources/News.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export function convertArticle({
status,
author,
member,
author_id: authorId,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
author_id: authorId, // we want to remove this field from output
...rest
} = article;
const a: gql.Article = {
Expand Down
3 changes: 1 addition & 2 deletions frontend/components/Calendar/EventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import articleStyles from '~/components/News/articleStyles';
import Comments from '~/components/Social/Comments/Comments';
import GoingButton from '~/components/Social/SocialButton/GoingButton';
import InterestedButton from '~/components/Social/SocialButton/InterestedButton';
import { authorIsUser } from '~/functions/authorFunctions';
import selectTranslation from '~/functions/selectTranslation';
import startAndEndDateToStringRows from '~/functions/startAndEndDateToStringRows';
import
Expand Down Expand Up @@ -267,7 +266,7 @@ export default function EventCard({
{event.organizer}
</Typography>

{(hasAccess(apiContext, 'event:update') || authorIsUser(event.author, user)) && (
{(hasAccess(apiContext, 'event:update') || event.author?.id === user.id) && (
<Link href={routes.editEvent(event.id)}>{t('edit')}</Link>
)}
</Stack>
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Link as MuiLink } from '@mui/material';
import NextLink from 'next/link';
import { Box, Link as MuiLink } from '@mui/material';
import React from 'react';

function Link({
href,
Expand Down
7 changes: 4 additions & 3 deletions frontend/components/News/ArticleRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import
{
authorIsUser,
getMemberSignature,
getSignature,
} from '~/functions/authorFunctions';

import Article from '~/components/News/article';
import
{
ArticleQuery,
ArticleRequest as ArticleRequestType,
ArticleRequestsQuery,
RejectedRequestsQuery,
useApproveRequestMutation, useRejectRequestMutation,
useUndoRejectionMutation,
} from '~/generated/graphql';
Expand Down Expand Up @@ -67,7 +67,7 @@ function ReasonPrompt({ open, onClose }: { open: boolean; onClose: (value?: stri
}

type ArticleProps = {
article: Omit<ArticleRequestType, 'author'> & { author: ArticleQuery['article']['author'] };
article: ArticleRequestsQuery['articleRequests'][number] | RejectedRequestsQuery['rejectedRequests']['articles'][number];
refetch?: () => void;
rejected?: boolean;
};
Expand All @@ -94,6 +94,7 @@ export default function ArticleRequest({
});
const fixedArticle: ArticleQuery['article'] = {
...article,
__typename: 'Article',
likers: [],
isLikedByMe: false,
comments: [],
Expand Down

0 comments on commit e32fad5

Please sign in to comment.