Skip to content

Commit

Permalink
PROD
Browse files Browse the repository at this point in the history
  • Loading branch information
husamahmud committed Aug 14, 2024
1 parent 4150416 commit 69919e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 56 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "LeetPush",
"version": "1.5.21",
"version": "1.6.21",
"description": "Effortlessly capture and push LeetCode solutions to your GitHub repository",
"background": {
"service_worker": "background.js"
Expand Down
50 changes: 0 additions & 50 deletions popup/README.md

This file was deleted.

8 changes: 3 additions & 5 deletions popup/src/lib/leetpush.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import {
UserStreakI,
} from '@/types/leetpush.interface.ts'

const VITE_LEETPUSH_API = 'http://localhost:3000/api/v2'

/**
* fetchDailyProblem - Fetch the daily problem from the LeetPush API
* @returns The daily problem
**/
export const fetchDailyProblem = async (): Promise<DailyProblemI> => {
const response = await fetch(`${VITE_LEETPUSH_API}/daily`)
const response = await fetch(`https://leet-push-api-git-master-husamahmuds-projects.vercel.app/api/v2/daily`)
if (!response.ok) throw new Error('Failed to fetch the daily problem')

const data = await response.json()
Expand All @@ -24,7 +22,7 @@ export const fetchDailyProblem = async (): Promise<DailyProblemI> => {
* @returns The user stats
**/
export const fetchUserStats = async (username: string): Promise<UserStatsI> => {
const response = await fetch(`${import.meta.env.VITE_LEETPUSH_API}/${username}`)
const response = await fetch(`https://leet-push-api-git-master-husamahmuds-projects.vercel.app/api/v2/${username}`)
if (response.status === 404) throw new Error('User not found')
else if (!response.ok) throw new Error('Failed to fetch user stats')

Expand All @@ -37,7 +35,7 @@ export const fetchUserStats = async (username: string): Promise<UserStatsI> => {
* @param username - The username of the user to fetch streak for
**/
export const fetchUserStreak = async (username: string): Promise<UserStreakI> => {
const response = await fetch(`${VITE_LEETPUSH_API}/userProfileCalendar/${username}`)
const response = await fetch(`https://leet-push-api-git-master-husamahmuds-projects.vercel.app/api/v2/userProfileCalendar/${username}`)
if (!response.ok) throw new Error('Failed to fetch user streak')

return await response.json()
Expand Down

0 comments on commit 69919e8

Please sign in to comment.