diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 64c8c7c8..1092d8c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [master] + branches: [master, alpha-v2] pull_request: - branches: [master] + branches: [master, alpha-v2] jobs: build: diff --git a/api/src/helpers/getFrequentPoster.ts b/api/src/helpers/getFrequentPoster.ts deleted file mode 100644 index df691c52..00000000 --- a/api/src/helpers/getFrequentPoster.ts +++ /dev/null @@ -1,24 +0,0 @@ -// TODO: #1173: this file was implemented purely for compatibility with the existing behavior -// As part of #1173, please remove all of it. -// Note: did not implement unit tests for this code due to its similarity to -// `getTopicAuthor` and the fact that we'll be removing it as part of #1173. -import { TopicPoster } from '../types'; - -import { getPosterTypeDetails } from './getPosterTypeDetails'; - -export function getFrequentPoster( - posters: Readonly>, -): TopicPoster | undefined { - return posters.find((poster) => { - const { isFrequentPoster } = getPosterTypeDetails(poster.description); - return isFrequentPoster; - }); -} - -export function getFrequentPosterUserId( - posters: Readonly>, -): number | undefined { - const author = getFrequentPoster(posters); - - return author?.userId ?? author?.user?.id; -} diff --git a/api/src/typeSchemas/Topic.ts b/api/src/typeSchemas/Topic.ts index 643fa099..c6671dc7 100644 --- a/api/src/typeSchemas/Topic.ts +++ b/api/src/typeSchemas/Topic.ts @@ -1,7 +1,6 @@ import { objectType } from 'nexus'; import { getTopicAuthorUserId } from '../helpers/getTopicAuthor'; -import { getFrequentPosterUserId } from '../helpers/getFrequentPoster'; export let Topic = objectType({ name: 'Topic', @@ -58,9 +57,6 @@ export let Topic = objectType({ t.nullable.int('authorUserId', { resolve: ({ posters }) => getTopicAuthorUserId(posters) ?? null, }); - t.nullable.int('frequentPosterUserId', { - resolve: ({ posters }) => getFrequentPosterUserId(posters) || null, - }); // Note: Comment out for maybe next phase // t.nullable.int('recentPosterUserId', { // resolve: ({ posters }) => { diff --git a/api/src/types/dataTypes.ts b/api/src/types/dataTypes.ts index 6a766732..ba424541 100644 --- a/api/src/types/dataTypes.ts +++ b/api/src/types/dataTypes.ts @@ -75,7 +75,6 @@ export type Topic = { pinnedGlobally: boolean | null; posters: Array; authorUserId?: number | null; - frequentPosterUserId?: number | null; }; type TagFilter = { diff --git a/frontend/src/graphql/server/getTopicDetail.ts b/frontend/src/graphql/server/getTopicDetail.ts index 1ba9c2c5..70fa61d1 100644 --- a/frontend/src/graphql/server/getTopicDetail.ts +++ b/frontend/src/graphql/server/getTopicDetail.ts @@ -36,7 +36,6 @@ export const TOPIC_FRAGMENT = gql` } } authorUserId - frequentPosterUserId pinned } `; diff --git a/frontend/src/graphql/server/topics.ts b/frontend/src/graphql/server/topics.ts index 58228dd3..a53e745f 100644 --- a/frontend/src/graphql/server/topics.ts +++ b/frontend/src/graphql/server/topics.ts @@ -54,7 +54,6 @@ export const TOPICS = gql` } } authorUserId - frequentPosterUserId pinned } }