/
nsstnc
/
lab3
Обзор
Документация
Войти
/
nsstnc
/
lab3
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/api/comments.ts
13 строк
555 B
nsstnc
Добавил функции для работы с ручками api
21 ноя 2025, 18:04
21 ноя 2025, 18:04
bacadf3
Код
Авторство
О чём код?
import api from './client' export const getComments = (taskId: number, includeTime = true) => api.get('/v1/comment/get', {params: {taskId, includeTime}}).then(r => r.data.comments) export const addComment = (taskId: number, message: string) => api.post('/v1/comment/add', {taskId, message}).then(r => r.data) export const updateComment = (id: number, message: string) => api.put('/v1/comment/update/message', {taskCommentId: id, message}) export const deleteComment = (id: number) => api.delete('/v1/comment/delete', {params: {commentId: id}})