daster/source/requests/delnumber.d

25 lines
523 B
D
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module requests.delnumber;
import vibe.vibe;
import response;
import structures;
import data;
import singlog;
void delNumber(HTTPServerRequest req, HTTPServerResponse res) {
auto jsr = req.json;
string number = jsr["number"].get!string;
if (!number.length) {
res.send(true, "Номер не может быть пуст");
return;
}
if (!sqlDeleteNumber(number)) {
res.send(true, "Не удалось удалить номер");
return;
}
res.send();
}