Delete Post

This page describes the request data identifiers and response structure required to implement post deletion.

HTML

<button type="button" class="h-btn-delete" data-post-key="AD570BDF1..." data-return-url="/post/list">DELETE</button>
  • button
    <button type="button" class="h-btn-delete" data-post-key="AD570BDF1..." data-return-url="/post/list"></button>

    Post delete button. The post[0].post_key value from the Response Result must be set in data-post-key.
    The class selector must include h-btn-delete.
    data-return-url specifies the URL of the page to move to after the post is deleted.

Response Result

  • When the Delete button is clicked, the post is deleted and the user is redirected to the URL defined in data-return-url.

Example

<button data-return-url="/post/list" :data-post-key="output.post[0].post_key" class="h-btn-delete" v-if="output.user.seq=output.post[0].member_seq">
Delete
</button>
<?php if($output['user']['seq']==$output['post'][0]['member_seq']){ ?>
    <button data-return-url="/post/list" data-post-key="<?=$output['post'][0]['post_key'];?>" class="h-btn-delete">
        Delete
    </button>
<?php } ?>