import request from './request' ; class TodoAPI { static PREFIX = '/todos' ; static fetchTodo ( userId ) { return request . get ( `${ TodoAPI . PREFIX }/${ userId }` ) ; } static addTodo ( userId , content ) { return request . post ( `${ TodoAPI . PREFIX }` , { userId , content , } ) ; } static searchTodo ( userId , query ) { return request . get ( `${ TodoAPI . PREFIX }/search?userId=${ userId }&query=${ query }` ) ; } static deleteTodo ( todoId ) { return request . delete ( `${ TodoAPI . PREFIX }/${ todoId }` ) ; } static updateTodoStatus ( todoId ) { return request . put ( `${ TodoAPI . PREFIX }/status` , { todoId , } ) ; } static updateTodoContent ( todoId , content ) { return request . put ( `${ TodoAPI . PREFIX }/content` , { todoId , content , } ) ; } } export default TodoAPI ;