Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer operation status for a specific user #38

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

BECATRUE
Copy link
Member

@BECATRUE BECATRUE commented Nov 28, 2024

This resolves #37.

I just improved ChannelInfoSerializer to include a in_use field.

You can test this feature using the code below.

import requests

HTTP_BASE_URL = 'http://localhost:8000'

with requests.Session() as session:
    data = {'username': 'OOOO', 'password': 'OOOO'}
    response = session.post(HTTP_BASE_URL + '/user/signin/', json=data)

    csrf_token = session.cookies.get('csrftoken')
    headers = {'X-CSRFToken': csrf_token}

    response = session.post(HTTP_BASE_URL + '/operation/1/', json={'on': True}, headers=headers)

    response = session.get(HTTP_BASE_URL + '/channel/', headers=headers)
    print(response.json())  # [{'channel': 1, 'name': 'OOOO', 'inUse': True}, ...]

    response = session.post(HTTP_BASE_URL + '/operation/1/', json={'on': False}, headers=headers)
    
    response = session.get(HTTP_BASE_URL + '/channel/', headers=headers)
    print(response.json())  # [{'channel': 1, 'name': 'OOOO', 'inUse': False}, ...]

    response = session.post(HTTP_BASE_URL + '/user/signout/', headers=headers)

(Updated at 241129)

I converted response data to camel case.

@BECATRUE BECATRUE added the enhancement New feature or request label Nov 28, 2024
@BECATRUE BECATRUE added this to the v1.0.0 milestone Nov 28, 2024
@BECATRUE BECATRUE requested a review from kangz12345 November 28, 2024 02:45
@BECATRUE BECATRUE self-assigned this Nov 28, 2024
@BECATRUE BECATRUE force-pushed the BECATRUE/37/offer-operation-for-user branch from 0c3ed7c to 7376cd9 Compare December 2, 2024 09:46
@BECATRUE
Copy link
Member Author

BECATRUE commented Dec 2, 2024

I just applied the PR #35.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Offer operation status for a specific user
1 participant