-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Definição do comportamento do envio do formulário de cadastro [Issue #…
…744]
- Loading branch information
1 parent
218d1a9
commit 3f1a6a0
Showing
3 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
//Escolher qual ação executar | ||
$acao = trim(filter_input(INPUT_POST, 'acao')); | ||
|
||
if(!$acao || empty($acao)){ | ||
http_response_code(400); | ||
echo json_encode(['erro' => 'Ação não definida']); | ||
exit(); | ||
} | ||
|
||
switch($acao){ | ||
case 'cadastrar': cadastrar();break; | ||
case 'atualizar': atualizar();break; | ||
default: echo json_encode(['erro' => 'Ação não válida']); exit(); | ||
} | ||
|
||
|
||
/** | ||
* Realiza os procedimentos necessários para inserir um novo sócio no banco de dados da aplicação | ||
*/ | ||
function cadastrar(){ | ||
http_response_code(200); | ||
echo json_encode(['retorno' => 'Sócio cadastrado']); | ||
} | ||
//Atualizar dados de sócio existente | ||
function atualizar(){ | ||
|
||
} |