TM1 Rest API – CRUD App – 3rd Chapter
https://www.c-sharpcorner.com/UploadFile/francissvk/crud-operations-in-Asp-Net-mvc-using-ado-net/

TM1 Rest API – CRUD App – 3rd Chapter

In this chapter we are going to discuss on update and delete operation of rest API. Among PUT/POST/Patch, based on the resource and operation type either one can be used. There are lots of online articles which talk about the uniqueness of each operation and their differences.?In our application a post operation is used to update an existing object for example: in a tm1 chore if we would like to update the active flag, we will send a post command

The web application has activate/deactivate button based on the current active flag value as shown below in chore-detail.js

No alt text provided for this image

If the chore is already in active state – the deactivate button will be enabled and vice versa. Also, the below code in chore-details.js show the activate functionality. It is same for deactivate expect for the url (at the end it will have tm1.Deactivate)?

No alt text provided for this image

The application will look as below based on the current state

No alt text provided for this image

Delete

The Delete rest api operation is called from the trash button (all buttons are free version from fontawesome website)

No alt text provided for this image

The onclick event calls an event function removeClicked when then calls the deleteChore in api-service.js (similar to createChore)

No alt text provided for this image

Links to - 1st Chapter , 2nd Chapter and 4th Chapter

要查看或添加评论,请登录

Akram Ali的更多文章

社区洞察

其他会员也浏览了