Skip to content

[Task] 사용자 단어 상태 API 서비스 구현 #67

Description

@DDINGJOO

상위 Story

목표

사용자 단어 학습 상태 조회/업데이트, 태그 변경 API 서비스 함수 구현

구현 내용

API 엔드포인트

함수 메서드 엔드포인트
userWordService.getList GET /vocab/users/{userId}/words
userWordService.update PUT /vocab/users/{userId}/words/{wordId}
userWordService.updateTag PUT /vocab/users/{userId}/words/{wordId}/tag

구현 예시

export const userWordService = {
  getList: (userId, { status, limit = 20, cursor } = {}) =>
    vocabApi.get(`/vocab/users/${userId}/words`, { params: { status, limit, cursor } }),
  
  update: (userId, wordId, isCorrect) =>
    vocabApi.put(`/vocab/users/${userId}/words/${wordId}`, { isCorrect }),
  
  updateTag: (userId, wordId, { bookmarked, favorite, difficulty }) =>
    vocabApi.put(`/vocab/users/${userId}/words/${wordId}/tag`, { bookmarked, favorite, difficulty }),
}

완료 조건

  • userWordService 객체 구현
  • 3개 API 함수 구현

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions