Projekt

Obecné

Profil

« Předchozí | Další » 

Revize d3c12593

Přidáno uživatelem Fantič před téměř 2 roky(ů)

re #10678 ItemViewUpdate: show related notes

Zobrazit rozdíly:

src/api/notesservice.ts
1 1
import { SortOptions } from "../types/general"
2
import { Item } from "../types/item";
2 3
import { Note } from "../types/note"
3 4
import { axiosInstance } from "./api"
4 5

  
5 6

  
6
export const getItemNotesRequest = async (itemId : string) => {
7
export const getItemNotesRequest = async (item : Item, relatedComments : boolean) => {
8
    
9
    let url =  `/notes/?item_id[]=${item.id}`;
10

  
11
    if(relatedComments && item.concordances && item.concordances.length > 0){
12
        for(let i = 0; i < item.concordances.length; i++){
13
            url += `&item_id[]=${item.concordances[i].id}` 
14
        }
15
    }
16
    console.log(url);
7 17
    return await axiosInstance.get(
8
        `/notes/?item_id[]=${itemId}`
18
        url
9 19
    )
10 20
}
11 21

  

Také k dispozici: Unified diff