- Find Movies You'll Enjoy Without the Hassle
+ Find Movies You'll Enjoy Without the Hassle
diff --git a/src/appwrite.js b/src/appwrite.js
index 4f991fe..4e03ece 100644
--- a/src/appwrite.js
+++ b/src/appwrite.js
@@ -1,11 +1,11 @@
-import { Client, Databases, ID, Query } from 'appwrite'
+import { Client, Databases, ID, Query } from "appwrite"
const PROJECT_ID = import.meta.env.VITE_APPWRITE_PROJECT_ID;
const DATABASE_ID = import.meta.env.VITE_APPWRITE_DATABASE_ID;
const COLLECTION_ID = import.meta.env.VITE_APPWRITE_COLLECTION_ID;
const client = new Client()
- .setEndpoint('https://cloud.appwrite.io/v1')
+ .setEndpoint("https://cloud.appwrite.io/v1")
.setProject(PROJECT_ID)
const database = new Databases(client);
@@ -14,7 +14,7 @@ export const updateSearchCount = async (searchTerm, movie) => {
// 1. Use Appwrite SDK to check if the search term exists in the database
try {
const result = await database.listDocuments(DATABASE_ID, COLLECTION_ID, [
- Query.equal('searchTerm', searchTerm),
+ Query.equal("searchTerm", searchTerm),
])
// 2. If it does, update the count
@@ -24,7 +24,7 @@ export const updateSearchCount = async (searchTerm, movie) => {
await database.updateDocument(DATABASE_ID, COLLECTION_ID, doc.$id, {
count: doc.count + 1,
})
- // 3. If it doesn't, create a new document with the search term and count as 1
+ // 3. If it doesn"t, create a new document with the search term and count as 1
} else {
await database.createDocument(DATABASE_ID, COLLECTION_ID, ID.unique(), {
searchTerm,
@@ -41,8 +41,8 @@ export const updateSearchCount = async (searchTerm, movie) => {
export const getTrendingMovies = async () => {
try {
const result = await database.listDocuments(DATABASE_ID, COLLECTION_ID, [
+ Query.orderDesc("count"),
Query.limit(5),
- Query.orderDesc("count")
])
return result.documents;
diff --git a/src/components/MovieCard.jsx b/src/components/MovieCard.jsx
index 72c2cdb..89c4882 100644
--- a/src/components/MovieCard.jsx
+++ b/src/components/MovieCard.jsx
@@ -1,4 +1,4 @@
-import React from 'react'
+import React from "react"
const MovieCard = ({ movie:
{ title, vote_average, poster_path, release_date, original_language }
@@ -7,7 +7,7 @@ const MovieCard = ({ movie:

@@ -17,7 +17,7 @@ const MovieCard = ({ movie:

-
{vote_average ? vote_average.toFixed(1) : 'N/A'}
+
{vote_average ? vote_average.toFixed(1) : "N/A"}
•
@@ -25,7 +25,7 @@ const MovieCard = ({ movie:
•
- {release_date ? release_date.split('-')[0] : 'N/A'}
+ {release_date ? release_date.split("-")[0] : "N/A"}
diff --git a/src/components/Search.jsx b/src/components/Search.jsx
index 0d16c7d..dec47db 100644
--- a/src/components/Search.jsx
+++ b/src/components/Search.jsx
@@ -1,4 +1,4 @@
-import React from 'react'
+import React from "react"
const Search = ({ searchTerm, setSearchTerm }) => {
return (
diff --git a/src/components/Spinner.jsx b/src/components/Spinner.jsx
index f257a5c..fe07605 100644
--- a/src/components/Spinner.jsx
+++ b/src/components/Spinner.jsx
@@ -1,4 +1,4 @@
-import React from 'react'
+import React from "react"
const Spinner = () => {
return (
diff --git a/src/main.jsx b/src/main.jsx
index 4d3b2a2..c8c4167 100644
--- a/src/main.jsx
+++ b/src/main.jsx
@@ -1,8 +1,8 @@
-import { StrictMode } from 'react'
-import { createRoot } from 'react-dom/client'
-import './index.css'
-import App from './App.jsx'
+import { StrictMode } from "react"
+import { createRoot } from "react-dom/client"
+import "./index.css"
+import App from "./App.jsx"
-createRoot(document.getElementById('root')).render(
+createRoot(document.getElementById("root")).render(
)
diff --git a/vite.config.js b/vite.config.js
index c4069b7..a7b2d99 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -1,6 +1,6 @@
-import { defineConfig } from 'vite'
-import react from '@vitejs/plugin-react'
-import tailwindcss from '@tailwindcss/vite'
+import { defineConfig } from "vite"
+import react from "@vitejs/plugin-react"
+import tailwindcss from "@tailwindcss/vite"
// https://vite.dev/config/
export default defineConfig({