From 41b9374b8c851806cb14e0f74b4605a9e3537ed2 Mon Sep 17 00:00:00 2001 From: Louis Girifalco Date: Fri, 27 Jun 2025 20:44:37 -0700 Subject: [PATCH 1/6] Add featuredPosts carousel --- src/graphql/query.jsx | 35 ++++++++++++++++++++++++++++++++++ src/views/SearchPage/index.jsx | 26 +++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/src/graphql/query.jsx b/src/graphql/query.jsx index 5de63f46..78e92a5e 100644 --- a/src/graphql/query.jsx +++ b/src/graphql/query.jsx @@ -493,3 +493,38 @@ export const GET_LATEST_QUOTES = gql` } } ` +export const GET_FEATURED_POSTS = gql` + query featuredPosts { + featuredPosts { + _id + userId + title + text + upvotes + downvotes + bookmarkedBy + created + url + featuredSlot + creator { + name + username + avatar + _id + } + votes { + _id + startWordIndex + endWordIndex + type + } + comments { _id } + quotes { _id } + messageRoom { + _id + messages { _id } + } + } + } +` + diff --git a/src/views/SearchPage/index.jsx b/src/views/SearchPage/index.jsx index 8356cc0d..09260b58 100644 --- a/src/views/SearchPage/index.jsx +++ b/src/views/SearchPage/index.jsx @@ -8,7 +8,7 @@ import DatePicker from 'react-datepicker'; import 'react-datepicker/dist/react-datepicker.css'; import format from 'date-fns/format'; import { jwtDecode } from 'jwt-decode'; -import { GET_TOP_POSTS } from '../../graphql/query'; +import { GET_TOP_POSTS, GET_FEATURED_POSTS } from '../../graphql/query'; import { serializePost } from '../../utils/objectIdSerializer'; import PostsList from '../../components/Post/PostsList'; import ErrorBoundary from '../../components/ErrorBoundary'; @@ -306,6 +306,8 @@ export default function SearchPage() { pollInterval: 3000, // Poll every 3 seconds }) + const { data: featuredData } = useQuery(GET_FEATURED_POSTS) + // Auto-show results for guest mode useEffect(() => { if (isGuestMode && !showResults) { @@ -467,6 +469,10 @@ export default function SearchPage() { const processedData = processAndSortData(data) + const featuredPosts = (featuredData?.featuredPosts || []) + .map((post) => serializePost(post)) + .sort((a, b) => (a.featuredSlot || 0) - (b.featuredSlot || 0)) + // Create carousel items from posts for guest mode const createCarouselItems = (posts) => { if (!posts || !posts.length) return [] @@ -564,7 +570,15 @@ export default function SearchPage() { - + + {featuredPosts.length > 0 && ( + + + {createCarouselItems(featuredPosts)} + + + )} + {/* Filter Buttons - Always visible */} + + {featuredPosts.length > 0 && ( + + + {createCarouselItems(featuredPosts)} + + + )} {!showResults && ( From a60cd279bbce2a3ae8ec8f12283604f55e2d6c2e Mon Sep 17 00:00:00 2001 From: Louis Girifalco Date: Fri, 27 Jun 2025 20:55:38 -0700 Subject: [PATCH 2/6] Update development API url --- .env.development | 6 +++--- README.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.env.development b/.env.development index 3aae4b84..70197e9e 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,6 @@ SKIP_PREFLIGHT_CHECK=true REACT_APP_DOMAIN=https://quote.vote -NODE_ENV=production -REACT_APP_SERVER=https://api.quote.vote -REACT_APP_SERVER_WS=ws://api.quote.vote +NODE_ENV=development +REACT_APP_SERVER=https://sandbox.quote.vote +REACT_APP_SERVER_WS=ws://sandbox.quote.vote HUSKY_SKIP_HOOKS=1 git rebase diff --git a/README.md b/README.md index 7229704e..d8d23153 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,9 @@ and democratic technologists alike. `git clone https://github.com/QuoteVote/quotevote-react.git && cd quotevote-react` 3. Create a `.env` file and add the following: ``` - NODE_ENV=dev - REACT_APP_SERVER=https://api.quote.vote - REACT_APP_SERVER_WS=wss://api.quote.vote + NODE_ENV=development + REACT_APP_SERVER=https://sandbox.quote.vote + REACT_APP_SERVER_WS=wss://sandbox.quote.vote REACT_APP_DOMAIN=https://quote.vote ``` From 2252282be247d9bbd57ec44d275e1a0bbd1241f8 Mon Sep 17 00:00:00 2001 From: Louis Girifalco Date: Fri, 27 Jun 2025 21:14:24 -0700 Subject: [PATCH 3/6] Add admin UI to manage featured posts --- src/graphql/mutations.jsx | 37 ++-- src/graphql/query.jsx | 211 ++++++++++--------- src/views/ControlPanel/ControlPanel.jsx | 207 +++++++++++++++--- src/views/ControlPanel/controlPanelStyles.js | 6 + 4 files changed, 309 insertions(+), 152 deletions(-) diff --git a/src/graphql/mutations.jsx b/src/graphql/mutations.jsx index c2c89e9d..2270dc11 100644 --- a/src/graphql/mutations.jsx +++ b/src/graphql/mutations.jsx @@ -9,7 +9,8 @@ export const CREATE_GROUP = gql` url created } - }` + } +` export const SUBMIT_POST = gql` mutation addPost($post: PostInput!) { @@ -70,7 +71,7 @@ export const ADD_QUOTE = gql` export const UPDATE_POST_BOOKMARK = gql` mutation updatePostBookmark($postId: String!, $userId: String!) { updatePostBookmark(postId: $postId, userId: $userId) { - _id, + _id bookmarkedBy } } @@ -100,12 +101,12 @@ export const FOLLOW_MUTATION = gql` ` export const REQUEST_USER_ACCESS_MUTATION = gql` -mutation requestUserAccess($requestUserAccessInput: RequestUserAccessInput!) { - requestUserAccess(requestUserAccessInput: $requestUserAccessInput) { - _id - email + mutation requestUserAccess($requestUserAccessInput: RequestUserAccessInput!) { + requestUserAccess(requestUserAccessInput: $requestUserAccessInput) { + _id + email + } } -} ` export const SEND_INVESTOR_EMAIL = gql` @@ -143,10 +144,7 @@ export const UPDATE_USER = gql` ` export const UPDATE_USER_AVATAR = gql` - mutation updateUserAvatar( - $user_id: String! - $avatarQualities: JSON - ) { + mutation updateUserAvatar($user_id: String!, $avatarQualities: JSON) { updateUserAvatar(user_id: $user_id, avatarQualities: $avatarQualities) { _id username @@ -158,9 +156,7 @@ export const UPDATE_USER_AVATAR = gql` ` export const CREATE_POST_MESSAGE_ROOM = gql` - mutation createPostMessageRoom( - $postId: String! - ) { + mutation createPostMessageRoom($postId: String!) { createPostMessageRoom(postId: $postId) { _id users @@ -214,7 +210,7 @@ export const ADD_ACTION_REACTION = gql` ` export const UPDATE_MESSAGE_REACTION = gql` - mutation updateReaction($_id: String! $emoji: String!) { + mutation updateReaction($_id: String!, $emoji: String!) { updateReaction(_id: $_id, emoji: $emoji) { _id emoji @@ -223,7 +219,7 @@ export const UPDATE_MESSAGE_REACTION = gql` ` export const UPDATE_ACTION_REACTION = gql` - mutation updateReaction($_id: String! $emoji: String!) { + mutation updateReaction($_id: String!, $emoji: String!) { updateReaction(_id: $_id, emoji: $emoji) { _id emoji @@ -247,3 +243,12 @@ export const DELETE_POST = gql` } } ` + +export const SET_FEATURED_SLOT = gql` + mutation SetFeaturedSlot($postId: ID!, $slot: Int) { + setFeaturedSlot(postId: $postId, slot: $slot) { + id + featuredSlot + } + } +` diff --git a/src/graphql/query.jsx b/src/graphql/query.jsx index 78e92a5e..e30ca417 100644 --- a/src/graphql/query.jsx +++ b/src/graphql/query.jsx @@ -1,18 +1,18 @@ import gql from 'graphql-tag' export const GROUPS_QUERY = gql` -query groups($limit: Int!) { - groups(limit: $limit) { - _id - creatorId - adminIds - allowedUserIds - privacy - title - url - description + query groups($limit: Int!) { + groups(limit: $limit) { + _id + creatorId + adminIds + allowedUserIds + privacy + title + url + description + } } -} ` export const USER_INVITE_REQUESTS = gql` @@ -162,7 +162,7 @@ export const GET_CHAT_ROOMS = gql` ` export const GET_ROOM_MESSAGES = gql` - query messages ($messageRoomId: String!){ + query messages($messageRoomId: String!) { messages(messageRoomId: $messageRoomId) { _id messageRoomId @@ -183,7 +183,7 @@ export const GET_ROOM_MESSAGES = gql` ` export const GET_MESSAGE_REACTIONS = gql` - query messageReactions ($messageId: String!){ + query messageReactions($messageId: String!) { messageReactions(messageId: $messageId) { _id emoji @@ -194,7 +194,7 @@ export const GET_MESSAGE_REACTIONS = gql` ` export const GET_ACTION_REACTIONS = gql` - query actionReactions ($actionId: String!){ + query actionReactions($actionId: String!) { actionReactions(actionId: $actionId) { _id emoji @@ -231,6 +231,7 @@ export const GET_TOP_POSTS = gql` bookmarkedBy created url + featuredSlot creator { name username @@ -292,6 +293,7 @@ export const GET_FRIENDS_POSTS = gql` bookmarkedBy created url + featuredSlot creator { name username @@ -342,101 +344,101 @@ export const GET_USER = gql` ` export const GET_USER_ACTIVITY = gql` -query activities( - $user_id: String! - $limit: Int! - $offset: Int! - $searchKey: String! - $startDateRange: String - $endDateRange: String - $activityEvent: JSON! -) { - activities( - user_id: $user_id - limit: $limit - offset: $offset - searchKey: $searchKey - startDateRange: $startDateRange - endDateRange: $endDateRange - activityEvent: $activityEvent + query activities( + $user_id: String! + $limit: Int! + $offset: Int! + $searchKey: String! + $startDateRange: String + $endDateRange: String + $activityEvent: JSON! ) { - entities { - created - postId - userId - user { - _id - name - username - avatar - } - activityType - content - post { - _id - title - text - url - upvotes - downvotes - votes { + activities( + user_id: $user_id + limit: $limit + offset: $offset + searchKey: $searchKey + startDateRange: $startDateRange + endDateRange: $endDateRange + activityEvent: $activityEvent + ) { + entities { + created + postId + userId + user { _id + name + username + avatar } - quotes { + activityType + content + post { _id + title + text + url + upvotes + downvotes + votes { + _id + } + quotes { + _id + } + comments { + _id + } + messageRoom { + _id + messages { + _id + } + } + bookmarkedBy + created + creator { + _id + name + username + avatar + } } - comments { + voteId + vote { _id + startWordIndex + endWordIndex + created + type + tags } - messageRoom { + commentId + comment { _id - messages { - _id - } + created + userId + content + startWordIndex + endWordIndex } - bookmarkedBy - created - creator { + quoteId + quote { _id - name - username - avatar + startWordIndex + endWordIndex + created + quote } } - voteId - vote { - _id - startWordIndex - endWordIndex - created - type - tags - } - commentId - comment { - _id - created - userId - content - startWordIndex - endWordIndex - } - quoteId - quote { - _id - startWordIndex - endWordIndex - created - quote + pagination { + total_count + limit + offset } } - pagination { - total_count - limit - offset - } } -} ` export const GET_CHECK_DUPLICATE_EMAIL = gql` @@ -451,18 +453,18 @@ export const VERIFY_PASSWORD_RESET_TOKEN = gql` ` export const GET_FOLLOW_INFO = gql` - query getUserFollowInfo($username: String! $filter: String) { + query getUserFollowInfo($username: String!, $filter: String) { getUserFollowInfo(username: $username, filter: $filter) } ` export const GET_NOTIFICATIONS = gql` - query notifications{ - notifications{ + query notifications { + notifications { _id userId userIdBy - userBy{ + userBy { _id name avatar @@ -518,13 +520,18 @@ export const GET_FEATURED_POSTS = gql` endWordIndex type } - comments { _id } - quotes { _id } + comments { + _id + } + quotes { + _id + } messageRoom { _id - messages { _id } + messages { + _id + } } } } ` - diff --git a/src/views/ControlPanel/ControlPanel.jsx b/src/views/ControlPanel/ControlPanel.jsx index e0ad6410..cfa8ae0b 100644 --- a/src/views/ControlPanel/ControlPanel.jsx +++ b/src/views/ControlPanel/ControlPanel.jsx @@ -1,3 +1,4 @@ +import React from 'react' import PropTypes from 'prop-types' import cx from 'classnames' import Grid from '@material-ui/core/Grid' @@ -10,13 +11,19 @@ import TableCell from '@material-ui/core/TableCell' import TableContainer from '@material-ui/core/TableContainer' import TableHead from '@material-ui/core/TableHead' import TableRow from '@material-ui/core/TableRow' +import Select from '@material-ui/core/Select' +import MenuItem from '@material-ui/core/MenuItem' +import FormControl from '@material-ui/core/FormControl' import Button from '@material-ui/core/Button' import Skeleton from '@material-ui/lab/Skeleton' import makeStyles from '@material-ui/core/styles/makeStyles' import { useMutation, useQuery } from '@apollo/react-hooks' -import { USER_INVITE_REQUESTS } from '@/graphql/query' -import { UPDATE_USER_INVITE_STATUS } from '@/graphql/mutations' +import { USER_INVITE_REQUESTS, GET_TOP_POSTS } from '@/graphql/query' +import { + UPDATE_USER_INVITE_STATUS, + SET_FEATURED_SLOT, +} from '@/graphql/mutations' // react plugin for creating charts import ChartistGraph from 'react-chartist' @@ -31,16 +38,20 @@ const useStyles = makeStyles(controlPanelStylwa) const ActionButtons = ({ status, id }) => { const classes = useStyles() - const [sendUserInviteApproval, { loading }] = useMutation(UPDATE_USER_INVITE_STATUS) + const [sendUserInviteApproval, { loading }] = useMutation( + UPDATE_USER_INVITE_STATUS, + ) const submitData = async (selectedStatus) => { await sendUserInviteApproval({ variables: { userId: id, inviteStatus: `${selectedStatus}`, }, - refetchQueries: [{ - query: USER_INVITE_REQUESTS, - }], + refetchQueries: [ + { + query: USER_INVITE_REQUESTS, + }, + ], }) } @@ -119,6 +130,124 @@ const ActionButtons = ({ status, id }) => { } } +const FeaturedPostsTable = () => { + const classes = useStyles() + const queryVars = { + limit: 50, + offset: 0, + searchKey: '', + startDateRange: null, + endDateRange: null, + friendsOnly: false, + } + const { data, refetch } = useQuery(GET_TOP_POSTS, { + variables: queryVars, + }) + const [setSlot, { loading }] = useMutation(SET_FEATURED_SLOT) + const [selection, setSelection] = React.useState({}) + + if (!data) { + return + } + + const posts = data.posts.entities + const usedSlots = {} + posts.forEach((p) => { + if (p.featuredSlot) usedSlots[p.featuredSlot] = p._id + }) + + const handleSelect = (id) => (e) => { + setSelection({ ...selection, [id]: e.target.value }) + } + + const handleSave = async (id) => { + const slot = selection[id] + await setSlot({ + variables: { postId: id, slot: slot ? Number(slot) : null }, + }) + refetch() + } + + return ( + + + Featured Posts + + + + + + Post ID + + + Title + + + Summary + + + Featured Slot + + + Action + + + + + {posts.map((post) => ( + + {post._id} + {post.title} + {(post.text || '').slice(0, 100)} + + + + + + + + + + ))} + +
+
+
+
+ ) +} + const ControlPanelContainer = ({ data }) => { const classes = useStyles() const header = ['Email', 'Status', 'Action'] @@ -141,11 +270,17 @@ const ControlPanelContainer = ({ data }) => { } } // eslint-disable-next-line radix - const inviteRequestCount = data.userInviteRequests.filter((user) => parseInt(user.status) === 1).length + const inviteRequestCount = data.userInviteRequests.filter( + (user) => parseInt(user.status) === 1, + ).length const totalUsers = data.userInviteRequests.length const result = data.userInviteRequests.reduce((_r, { joined }) => { const dateObj = moment(joined).format('yyyy-MM-01') - const objectKey = dateObj.toLocaleString('en-us', { year: 'numeric', month: 'numeric', day: 'numeric' }) + const objectKey = dateObj.toLocaleString('en-us', { + year: 'numeric', + month: 'numeric', + day: 'numeric', + }) const r = { ..._r } // decouple instance if (!r[objectKey]) r[objectKey] = { objectKey, entries: 1 } else r[objectKey].entries++ @@ -155,7 +290,10 @@ const ControlPanelContainer = ({ data }) => { const lineSeries = labels.map((label) => result[label].entries) const formatLabels = labels.map((label) => { const dateObj = new Date(label) - return dateObj.toLocaleString('en-us', { month: 'numeric', year: 'numeric' }) + return dateObj.toLocaleString('en-us', { + month: 'numeric', + year: 'numeric', + }) }) const chartData = { labels: formatLabels, @@ -177,15 +315,23 @@ const ControlPanelContainer = ({ data }) => { return ( - Invite Control Panel + + Invite Control Panel + - User Invitation Requests + + User Invitation Requests + - +
{header.map((name) => ( @@ -231,10 +377,7 @@ const ControlPanelContainer = ({ data }) => { - + User Invitation Statistics { display="inline" style={{ float: 'right' }} > - Invite Requests: - {' '} - {inviteRequestCount || 0} + Invite Requests: {inviteRequestCount || 0} - - Total Users: - {' '} - {totalUsers || 0} + + Total Users: {totalUsers || 0} - Active Users Today: - {' '} - {activeUsersCount} + Active Users Today: {activeUsersCount} + + + ) @@ -284,12 +425,10 @@ const ControlPanel = () => { const classes = useStyles() const { admin } = useSelector((state) => state.user.data) if (!admin) { - return () + return } if (data) { - return ( - - ) + return } return ( diff --git a/src/views/ControlPanel/controlPanelStyles.js b/src/views/ControlPanel/controlPanelStyles.js index 1c1f3488..dccd7a83 100644 --- a/src/views/ControlPanel/controlPanelStyles.js +++ b/src/views/ControlPanel/controlPanelStyles.js @@ -87,6 +87,12 @@ const requestAccessStyles = (theme) => ({ lineHeight: 1.39, color: '#333333', }, + featuredRow: { + backgroundColor: '#fff8e1', + }, + slotSelect: { + minWidth: 80, + }, }) export default requestAccessStyles From c35656d38619cfa6d3e72ba727b98962fbe471ce Mon Sep 17 00:00:00 2001 From: Louis Girifalco Date: Fri, 27 Jun 2025 21:21:57 -0700 Subject: [PATCH 4/6] Fix post queries for sandbox --- src/graphql/query.jsx | 3 --- src/views/SearchPage/index.jsx | 1 - 2 files changed, 4 deletions(-) diff --git a/src/graphql/query.jsx b/src/graphql/query.jsx index e30ca417..33db6611 100644 --- a/src/graphql/query.jsx +++ b/src/graphql/query.jsx @@ -231,7 +231,6 @@ export const GET_TOP_POSTS = gql` bookmarkedBy created url - featuredSlot creator { name username @@ -293,7 +292,6 @@ export const GET_FRIENDS_POSTS = gql` bookmarkedBy created url - featuredSlot creator { name username @@ -507,7 +505,6 @@ export const GET_FEATURED_POSTS = gql` bookmarkedBy created url - featuredSlot creator { name username diff --git a/src/views/SearchPage/index.jsx b/src/views/SearchPage/index.jsx index 09260b58..6561093e 100644 --- a/src/views/SearchPage/index.jsx +++ b/src/views/SearchPage/index.jsx @@ -471,7 +471,6 @@ export default function SearchPage() { const featuredPosts = (featuredData?.featuredPosts || []) .map((post) => serializePost(post)) - .sort((a, b) => (a.featuredSlot || 0) - (b.featuredSlot || 0)) // Create carousel items from posts for guest mode const createCarouselItems = (posts) => { From d92c763fa8c7e1614582eec6075393ee13bfee55 Mon Sep 17 00:00:00 2001 From: Louis Girifalco Date: Fri, 27 Jun 2025 22:00:28 -0700 Subject: [PATCH 5/6] Add filter for featured posts table --- src/views/ControlPanel/ControlPanel.jsx | 21 +++++++++++++++++++- src/views/ControlPanel/controlPanelStyles.js | 3 +++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/views/ControlPanel/ControlPanel.jsx b/src/views/ControlPanel/ControlPanel.jsx index cfa8ae0b..d60c84e4 100644 --- a/src/views/ControlPanel/ControlPanel.jsx +++ b/src/views/ControlPanel/ControlPanel.jsx @@ -14,6 +14,7 @@ import TableRow from '@material-ui/core/TableRow' import Select from '@material-ui/core/Select' import MenuItem from '@material-ui/core/MenuItem' import FormControl from '@material-ui/core/FormControl' +import TextField from '@material-ui/core/TextField' import Button from '@material-ui/core/Button' import Skeleton from '@material-ui/lab/Skeleton' import makeStyles from '@material-ui/core/styles/makeStyles' @@ -145,6 +146,7 @@ const FeaturedPostsTable = () => { }) const [setSlot, { loading }] = useMutation(SET_FEATURED_SLOT) const [selection, setSelection] = React.useState({}) + const [filter, setFilter] = React.useState('') if (!data) { return @@ -156,6 +158,15 @@ const FeaturedPostsTable = () => { if (p.featuredSlot) usedSlots[p.featuredSlot] = p._id }) + const filteredPosts = posts.filter((p) => { + const q = filter.toLowerCase() + return ( + p.title.toLowerCase().includes(q) || + (p.text || '').toLowerCase().includes(q) || + p._id.includes(q) + ) + }) + const handleSelect = (id) => (e) => { setSelection({ ...selection, [id]: e.target.value }) } @@ -172,6 +183,14 @@ const FeaturedPostsTable = () => { Featured Posts + setFilter(e.target.value)} + className={classes.filterInput} + />
@@ -194,7 +213,7 @@ const FeaturedPostsTable = () => { - {posts.map((post) => ( + {filteredPosts.map((post) => ( ({ slotSelect: { minWidth: 80, }, + filterInput: { + marginBottom: 15, + }, }) export default requestAccessStyles From 8c3bc21591fffdbaf8ec354649f715fba3b21d7d Mon Sep 17 00:00:00 2001 From: Louis Girifalco Date: Fri, 27 Jun 2025 22:00:33 -0700 Subject: [PATCH 6/6] Fix featured slot mutation --- src/graphql/mutations.jsx | 8 ++++---- src/views/ControlPanel/ControlPanel.jsx | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/graphql/mutations.jsx b/src/graphql/mutations.jsx index 2270dc11..8420f304 100644 --- a/src/graphql/mutations.jsx +++ b/src/graphql/mutations.jsx @@ -244,10 +244,10 @@ export const DELETE_POST = gql` } ` -export const SET_FEATURED_SLOT = gql` - mutation SetFeaturedSlot($postId: ID!, $slot: Int) { - setFeaturedSlot(postId: $postId, slot: $slot) { - id +export const UPDATE_FEATURED_SLOT = gql` + mutation updateFeaturedSlot($postId: String!, $featuredSlot: Int) { + updateFeaturedSlot(postId: $postId, featuredSlot: $featuredSlot) { + _id featuredSlot } } diff --git a/src/views/ControlPanel/ControlPanel.jsx b/src/views/ControlPanel/ControlPanel.jsx index d60c84e4..e6d3c494 100644 --- a/src/views/ControlPanel/ControlPanel.jsx +++ b/src/views/ControlPanel/ControlPanel.jsx @@ -23,7 +23,7 @@ import { useMutation, useQuery } from '@apollo/react-hooks' import { USER_INVITE_REQUESTS, GET_TOP_POSTS } from '@/graphql/query' import { UPDATE_USER_INVITE_STATUS, - SET_FEATURED_SLOT, + UPDATE_FEATURED_SLOT, } from '@/graphql/mutations' // react plugin for creating charts @@ -144,7 +144,7 @@ const FeaturedPostsTable = () => { const { data, refetch } = useQuery(GET_TOP_POSTS, { variables: queryVars, }) - const [setSlot, { loading }] = useMutation(SET_FEATURED_SLOT) + const [updateSlot, { loading }] = useMutation(UPDATE_FEATURED_SLOT) const [selection, setSelection] = React.useState({}) const [filter, setFilter] = React.useState('') @@ -173,8 +173,8 @@ const FeaturedPostsTable = () => { const handleSave = async (id) => { const slot = selection[id] - await setSlot({ - variables: { postId: id, slot: slot ? Number(slot) : null }, + await updateSlot({ + variables: { postId: id, featuredSlot: slot ? Number(slot) : null }, }) refetch() }