1
0
Fork 0
mirror of synced 2024-10-02 02:07:04 +13:00

Default topic description to an empty string instead of null

Not using nulls makes things more type safe.
This commit is contained in:
Steven Nguyen 2024-01-11 02:06:56 +00:00
parent 07b6ee58fe
commit 74a7ffbf7a
No known key found for this signature in database
GPG key ID: 22EB8611C67E9E5C
2 changed files with 2 additions and 4 deletions

View file

@ -1696,12 +1696,9 @@ App::post('/v1/messaging/topics')
$topic = new Document([
'$id' => $topicId,
'name' => $name,
'description' => $description
]);
if ($description) {
$topic->setAttribute('description', $description);
}
try {
$topic = $dbForProject->createDocument('topics', $topic);
} catch (DuplicateException) {

View file

@ -245,6 +245,7 @@ trait MessagingBase
]);
$this->assertEquals(201, $response['headers']['status-code']);
$this->assertEquals('my-app', $response['body']['name']);
$this->assertEquals('', $response['body']['description']);
return $response['body'];
}