Skip to content

Conversation

@jctimbol
Copy link

@jctimbol jctimbol commented Jan 2, 2026

for issue #1952

@adarshm11
Copy link
Contributor

add a screenshot!!

@jctimbol
Copy link
Author

jctimbol commented Jan 4, 2026

Screenshot 2026-01-03 at 9 27 42 PM

on bottom right of the home page

@adarshm11
Copy link
Contributor

looks good, make sure you fix lint errors, you can run npm run lint to see what's failing and where

Comment on lines +5 to +10
{
visitCount: {
type: Number,
default: 0
}
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add one more field, its called type, and it can be an enum like ['HOME_PAGE'] for now

we can then add more stuff to this schema later if we want to track visits to other pages

const router = express.Router();
const visitCounter = require('../models/HomepageVisit');
const { FORBIDDEN, BAD_REQUEST, OK } = require('../../util/constants').STATUS_CODES;
const allowedOrigin = 'https://sce.sjsu.edu';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about if its in dev mode? could we only check if we are in prod?

like if (process.env.NODE_ENV === 'production')

also lets name this variable SCE_SJSU_EDU

export async function getVisitCount() {
let status = new ApiResponse();
try {
const res = await fetch (BASE_API_URL + 'api/Homepage/count');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please create and use the url class like below

const res = await fetch(url.href, {

export async function incrementVisitCount() {
let status = new ApiResponse();
try {
await fetch (BASE_API_URL + 'api/Homepage/visit', {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see other comment about url class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants