Skip to content

Commit

Permalink
refactor: 요청 후 받은 상수 데이터를 변경되지 않도록 let 에서 const 로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
geongyu09 committed Jun 26, 2024
1 parent fd10d23 commit 702a922
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/service/contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ const TABLE_NAME = import.meta.env.VITE_TABLE_NAME;
const BUCKET_NAME = import.meta.env.VITE_BUCKET_NAME;

export const getContents = async () => {
let { data: blog, error } = await supabase.from(TABLE_NAME).select("*");
const { data: blog, error } = await supabase.from(TABLE_NAME).select("*");
if (error) throw new Error(error.message);
return blog;
};

export const getImageUrl = async (contentId) => {
const directory = `content/${contentId}`;

let { data: image, error } = supabase.storage
const { data: image, error } = supabase.storage
.from(BUCKET_NAME)
.getPublicUrl(directory);
if (error) throw new Error(error.message);
Expand Down Expand Up @@ -53,7 +53,7 @@ const uploadImage = async (file, id) => {
};

export const getContentById = async (id) => {
let { data, error } = await supabase
const { data, error } = await supabase
.from(TABLE_NAME)
.select("*")
.eq("id", id);
Expand Down

0 comments on commit 702a922

Please sign in to comment.