Skip to content

Commit

Permalink
allow deleting files by providing null as value
Browse files Browse the repository at this point in the history
  • Loading branch information
david-plugge committed Feb 6, 2024
1 parent 44d6dd8 commit 1c8e68b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"gold-socks-wink",
"honest-ants-rest",
"sixty-hotels-complain",
"smooth-insects-guess",
"tough-books-smoke",
"young-apes-brush"
]
Expand Down
5 changes: 5 additions & 0 deletions .changeset/smooth-insects-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"typed-pocketbase": patch
---

allow deleting files by providing null as value
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# typed-pocketbase

## 0.1.0-pre.7

### Patch Changes

- allow deleting files by providing null as value

## 0.1.0-pre.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typed-pocketbase",
"version": "0.1.0-pre.6",
"version": "0.1.0-pre.7",
"description": "Add types to the PocketBase JavaScript SDK",
"author": "David Plugge",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/codegen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ function getFieldType(field: Field, { response, create, update }: Columns) {
const single = field.options.maxSelect === 1;

addResponse(single ? 'string' : `Array<string>`);
addCreate(single ? `File` : `MaybeArray<File>`);
addUpdate(single ? `File` : `MaybeArray<File>`);
addCreate(single ? `File | null` : `MaybeArray<File>`);
addUpdate(single ? `File | null` : `MaybeArray<File>`);
if (!single) {
addUpdate('string', `'${field.name}-'`);
}
Expand Down

0 comments on commit 1c8e68b

Please sign in to comment.