Skip to content

Commit be5cad2

Browse files
committed
fix: remove undefined title/content fields from note creation request
1 parent 72d8577 commit be5cad2

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/lib/api/api.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,12 @@ class ClerkEncryptedApiService {
250250

251251
const encryptedData = await this.encryptNoteForApi(title, content);
252252

253+
const { title: _, content: __, ...restNoteData } = noteData;
254+
253255
const apiNote = await this.request<ApiNote>('/notes', {
254256
method: 'POST',
255257
body: JSON.stringify({
256-
...noteData,
257-
// Remove plain text fields completely when sending encrypted data
258-
title: undefined,
259-
content: undefined,
258+
...restNoteData,
260259
...encryptedData,
261260
}),
262261
});

0 commit comments

Comments
 (0)