New TODO
This commit is contained in:
parent
cf73d084b5
commit
3849ceffae
|
@ -40,3 +40,7 @@ Mojolicious blockchain technologies powered by AI.
|
||||||
Result: PASS
|
Result: PASS
|
||||||
|
|
||||||
Add the `-v` option for more verbose output
|
Add the `-v` option for more verbose output
|
||||||
|
|
||||||
|
## TODOs
|
||||||
|
|
||||||
|
1. Input validation
|
||||||
|
|
|
@ -63,7 +63,7 @@ any [qw{GET POST}], '/sign' => sub ($c) {
|
||||||
my $message = $c->param('message');
|
my $message = $c->param('message');
|
||||||
my $answer = $c->param('answer');
|
my $answer = $c->param('answer');
|
||||||
|
|
||||||
$c->message->send_post($name, $message) if $answer;
|
$c->message->create_post($name, $message) if $answer;
|
||||||
$c->redirect_to('index');
|
$c->redirect_to('index');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -21,7 +21,7 @@ sub get_posts($self) {
|
||||||
ORDER BY date DESC;')->arrays()
|
ORDER BY date DESC;')->arrays()
|
||||||
}
|
}
|
||||||
|
|
||||||
sub send_post($self, $name, $msg) {
|
sub create_post($self, $name, $msg) {
|
||||||
$self->pg->db->query(
|
$self->pg->db->query(
|
||||||
'INSERT INTO messages (date, name, msg)
|
'INSERT INTO messages (date, name, msg)
|
||||||
VALUES (NOW(), ?, ?);', $name, $msg
|
VALUES (NOW(), ?, ?);', $name, $msg
|
||||||
|
|
Loading…
Reference in New Issue
Block a user