1.0.3 • Published 5 years ago
@crud/jquery v1.0.3
#CRUD Operations in Javascript
Installation
npm install @crud/core
or
yarn add @crud/core
Usage
import {CrudRequest} from "@crud/core";
const crud = new CrudRequest();
Config
import {ReQuestOptions} from "@crud/core";
crud.config((config:RequestOptions)=>{
config.callbacks.redirect = (to:string)=>{
window.location.href = to;
}
config.callbacks.reload = ()=>{
window.location.reload();
}
return config;
})
Methods in CrudRequest
Signature | Description |
---|---|
send(options: RequestOptions)=>Promise<any> | Used to send the request to send data to server and get the response |
create(url:string, options: RequestOptions)=>Promise<any> | Used to send a create request to server using the send method, but overrides some options to modify the request. |
retrieve(url: string, options: RequestOptions)=>Promise<any> | Used to send a retrieve request to server using the send method, but overrides some options to modify the request. |
update(url:string, options: RequeestOptions)=>Promise<any> | Used to send an update request to server using the send method, but overrides some options to modify the request. |
delete(url:string, options: RequeestOptions)=>Promise<any> | Used to send a delete request to server using the send method, but overrides some options to modify the request. |