the-canonizer / canonizer-3.0-frontend

Frontend of canonizer3.0
3 stars 2 forks source link

AutoSave camp statement #1951

Open sunnyjindal opened 1 month ago

sunnyjindal commented 1 month ago

While creating a camp statement, we should have the feature where camp statement is autosaved in the database. The camp statement will be saved in a draft mode unless published by the user.

M-Darab commented 1 month ago

To make a draft, /api/v3/store-camp-statement will be used with additional payload of

{
    "is_draft": true, 
    "event_type": "create"
}

And in response, draft_record_id will be received

{
    "status_code": 200,
    "message": "Draft submitted successfully.",
    "error": "",
    "data": {
        "draft_record_id": 3510
    }
}

To autosave a draft, /api/v3/store-camp-statement will be used with additional payload of

{
    "is_draft": true, 
    "event_type": "edit",
    "statement_id": "draft_record_id",
}

To Submit a draft as change, /api/v3/store-camp-statement will be used with additional payload of

{
    "is_draft": false, 
    "event_type": "create",
    "statement_id": "draft_record_id",
}

@wahaj-hafeez use above API for autosave.

wahaj-hafeez commented 1 month ago

Ok ! @M-Darab

wahaj-hafeez commented 3 weeks ago

PR: https://github.com/the-canonizer/canonizer-3.0-frontend/pull/2021

sajid315 commented 2 weeks ago

@wahaj-hafeez We need to address following issues while saving draft, 1- Restrict multiple API call on multi click on save as draft button. 2- Manage Statement button should be shown to direct supporter, when another direct supporter submits a change in statement. 3- "Sign Petition" UI issue is disabled view.

image

wahaj-hafeez commented 2 weeks ago

These issues are fixed 1- Restrict multiple API call on multi click on save as draft button. 2- Manage Statement button should be shown to direct supporter, when another direct supporter submits a change in statement. 3- "Sign Petition" UI issue is disabled view.

PR: https://github.com/the-canonizer/canonizer-3.0-frontend/pull/2065