Create Teams response returning null

Đang mở
#1,874 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
api

Hướng nghiên cứu

Reproduce the client.api('/teams').post(createTeamPayload) call and inspect how its response is exposed, especially the ReadableStream and response.headers values. Compare the observed result with the expected 202 response and location headers; done means the SDK provides the relevant response metadata without returning undefined.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Needs: Attention :wave:
const createTeam = async (accessToken: string, teamName: string) => {
        const userId = USER_DETAILS['email'];
        const client = Client.initWithMiddleware({
            authProvider: new CustomTokenCredential(accessToken),
        });

        const createTeamPayload = {
            "template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
            "displayName": "Roundglass",
            "description": "My Sample Team's Description",
            "members": [
                {
                    "@odata.type": "#microsoft.graph.aadUserConversationMember",
                    "roles": ["owner"],
                    "user@odata.bind": "https://graph.microsoft.com/v1.0/users/" + userId
                }
            ]
        };

        try {
            const response = await client.api('/teams').post(createTeamPayload);
            console.log(response);
            console.log("Team created:", response.headers);
            console.log("Team created:", response.headers.location);
        } catch (error) {
            console.error("Error creating team:", error);
        }
    };

this is response which is coming

ReadableStream {locked: false}locked: false[[Prototype]]: ReadableStream
   Team created: undefined
  

expected response should be

    HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /teams('dbd8de4f-5d47-48da-87f1-594bed003375')/operations('3a6fdce1-c261-48bc-89de-1cfef658c0d5')
Content-Location: /teams('dbd8de4f-5d47-48da-87f1-594bed003375')
Content-Length: 0
Ngôn ngữ chính
TypeScript
Star
833
Fork
240
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoftgraph/msgraph-sdk-javascript

Tất cả issue của microsoftgraph/msgraph-sdk-javascript

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.