Small fixes
This commit is contained in:
parent
01212543fe
commit
c82acc8f52
|
@ -43,11 +43,17 @@ class TicketApiController extends ApiController
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function create(string $title, string $content): DataResponse
|
||||
{
|
||||
return new DataResponse($this->service->create($title, $content, $this->userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function update(int $id, string $title, string $content): DataResponse
|
||||
{
|
||||
return $this->handleNotFound(function () use ($id, $title, $content) {
|
||||
|
|
|
@ -63,7 +63,7 @@ class Version000000Date20210918151800 extends SimpleMigrationStep {
|
|||
]);
|
||||
$table->addColumn('user_id', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 200,
|
||||
'length' => 64,
|
||||
]);
|
||||
$table->addColumn('matrix_user', 'string', [
|
||||
'notnull' => true,
|
||||
|
@ -77,7 +77,7 @@ class Version000000Date20210918151800 extends SimpleMigrationStep {
|
|||
$table->setPrimaryKey(['id']);
|
||||
$table->addUniqueConstraint(['user_id'], 'upschooling_mx_user_nc_uniq');
|
||||
$table->addUniqueConstraint(['matrix_user'], 'upschooling_mx_user_mx_uniq');
|
||||
$table->addForeignKeyConstraint('users', ['user_id'], ['id'], [], 'upschooling_mx_user_nc_fk');
|
||||
$table->addForeignKeyConstraint('users', ['user_id'], ['uid'], [], 'upschooling_mx_user_nc_fk');
|
||||
}
|
||||
return $schema;
|
||||
}
|
||||
|
|
|
@ -114,7 +114,8 @@ class MatrixService
|
|||
null,
|
||||
[],
|
||||
[],
|
||||
'/_synapse/admin/v1', true
|
||||
'/_synapse/admin/v1',
|
||||
true
|
||||
);
|
||||
$randUsername = trim(str_replace(["/", "+"], ".", base64_encode(random_bytes(6))), "=");
|
||||
$username = "upschooling_" . $randUsername;
|
||||
|
@ -134,7 +135,8 @@ class MatrixService
|
|||
),
|
||||
[],
|
||||
[],
|
||||
'/_synapse/admin/v1', true
|
||||
'/_synapse/admin/v1',
|
||||
true
|
||||
);
|
||||
|
||||
$matrixUser = new MatrixUser();
|
||||
|
|
|
@ -48,6 +48,8 @@ class TicketService {
|
|||
// id is to be set from the remote support-platform Nextcloud
|
||||
"title" => $title,
|
||||
"description" => $content,
|
||||
"status" => "open",
|
||||
"version" => "1",
|
||||
));
|
||||
$ticket = new MatrixTicket();
|
||||
$ticket->setMatrixRoom($roomId);
|
||||
|
|
Loading…
Reference in a new issue