File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { TENANT_ID } from "../constants/todo" ;
12import { Todo } from "../types/todo" ;
23import { PatchItemPayload } from "./types" ;
34
45export const getTodos = async ( ) : Promise < Todo [ ] > => {
56 const res = await fetch (
6- " https://assignment-todolist-api.vercel.app/api/jinsun /items?page=1&pageSize=30"
7+ ` https://assignment-todolist-api.vercel.app/api/${ TENANT_ID } /items?page=1&pageSize=30`
78 ) ;
89 const json = await res . json ( ) ;
910 return json ?? [ ] ;
@@ -14,7 +15,7 @@ export const patchItem = async (
1415 data : PatchItemPayload
1516) : Promise < void > => {
1617 const res = await fetch (
17- `https://assignment-todolist-api.vercel.app/api/jinsun /items/${ itemId } ` ,
18+ `https://assignment-todolist-api.vercel.app/api/${ TENANT_ID } /items/${ itemId } ` ,
1819 {
1920 method : "PATCH" ,
2021 headers : {
@@ -32,7 +33,7 @@ export const patchItem = async (
3233
3334export const addTodo = async ( name : string ) : Promise < void > => {
3435 const res = await fetch (
35- " https://assignment-todolist-api.vercel.app/api/jinsun /items" ,
36+ ` https://assignment-todolist-api.vercel.app/api/${ TENANT_ID } /items` ,
3637 {
3738 method : "POST" ,
3839 body : JSON . stringify ( { name } ) ,
Original file line number Diff line number Diff line change 1+ export const TENANT_ID = "jinsunkimdev"
You can’t perform that action at this time.
0 commit comments