How to delete data from mockapi.io? - api

I want to delete an element from an array that I fetch from mockapi.io.
Link: https://6335cd5d8aa85b7c5d237173.mockapi.io/notes
What do I do for this?
In settings, everything works fine
Unfortunately I don't understand why I can't delete any item.
If you need anything, write me. Thank you!

Related

How to prevent jspreadsheet from generating another excel each time it is executed

[[enter image description enter image description herehere](https://i.stack.imgur.com/9OaRf.png)](https://i.stack.imgur.com/iVDTH.png)
The logic is like this, every time I delete or update a set of data, I think I need to execute it again, this.$jexcel((this.$refs.excel.$el, this.sheet),How can I not generate a new excel?heple me please
i looking forward someone help me slove the question,

I am trying to create a URL but the URL must contain \r\n

I have been beating my head against the wall with this one. The url must contain \r\n at the end or the device I am connecting to will not recognise it. I did not create the device so I can't go in and change what it is looking for. I also can not use the percent values for them either. When I create the URL from a string the URL becomes nil because it does not like the \r\n. I have searched on here all day. Literally and have come up with nothing. If anyone has a suggestion please let me know. I would really appreciate it.
Edit.. The url is #"http://192.168.1.1/link.html?cmd=scan\r\n"
I was able to figure out another way in so I did not have to send the string like that. Thank for the help.
Try this:
NSLog(#"http://192.168.1.1/link.html?cmd=scan\\r\\n");
OutPut:
http://192.168.1.1/link.html?cmd=scan\r\n
You have to skip the "\" with just putting another "\".

How to delete a db row in LINQPAD

Total NOOB question. I have been using the new linqpad for about 20 minutes now. Great!
But now i want to delete a row in the db. I am using a EF5.0 connection. I cant seem to find anything in the help files or on the net. The only thing I can find is DeleteOnSubmit which doesnt work with EF (as far as I can see). I have also tried DeleteObject which doesnt work either. This is what I have tried.
var co = Companies.First();
co.Dump();
Companies.DeleteObject(co);
This is old... and I don't know if/when this was added (probably in response to this exact scenario)… but you can accomplish this (in your given example) as follows:
//test the following line to ensure the context doesn't complain about the .First() reference
Companies.DeleteOnSubmit(Companies.First());
Companies.Context.SubmitChanges();
You need to SaveChanges on your context (Companies) for your row to be deleted.
Companies.SaveChanges();

Products Index Check on Image

First making use of PaperClip.
On the Index File i have a list of the Products in the database.
What would be the best way to check if there is a image save in the database.
Paperclips fields are standard
So i thought i would be best to do a check on the image_file_name field.
So if it is null then show one image else if not null show another icon.
Any ideas here.
Managed to Solve it
If anyone is looking for this solution.
This will check any field if it is empty then display an image/icon and display another when not
<%= product.image_file_name? ? image_tag('imagesuccess.png') : image_tag('noimage.png')%>
Hope this helps Someone

Clear all records from a store

I have a store, I am loading records from it successfully. Now i need to clear all the records in it. How can i do this ?
myStore.remove(); // DID NOT WORK
myStore.clear(); // ENDED UP WITH AN ERROR TypeError: myStore.clear is not a function
How could i solve this?
Remove will remove the records you pass in. You want removeAll as in myStore.removeAll();
I find out that, at least on ExtJS 4.2.3, removeAll give an error the first time it is issued after a load. I got it resolved by doing:
store.clearData();
store.removeAll();
myStore.loadData([],false); is the solution.
I'm using version 2.0.12 and none of the above solutions worked. I read their readme.md and found store.clearAll();.
That was my solution.