Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types for View collections include created and updated #92

Open
Shmookoff opened this issue Nov 13, 2023 · 0 comments
Open

Types for View collections include created and updated #92

Shmookoff opened this issue Nov 13, 2023 · 0 comments

Comments

@Shmookoff
Copy link

Shmookoff commented Nov 13, 2023

Describe the bug
Types for View collections are generated with created and updated, while View collections do not require or enforce those fields.

Example View collection Response:

{
  "id": "RECORD_ID",
  "collectionId": "dxgefcmqccxee01",
  "collectionName": "shifts",
  "user": "RELATION_RECORD_ID",
  "clockIn": "RELATION_RECORD_ID",
  "clockOut": "RELATION_RECORD_ID"
}

Generated Response type:

export type ShiftsResponse<Texpand = unknown> = Required<ShiftsRecord> & BaseSystemFields<Texpand>

BaseSystemFields includes created and updated so ShiftsResponse ends up with those fields.

I'm using env generation (pocketbase-typegen --env)

Versions
pocketbase-typegen version: 1.2.1
pocketbase version: 0.19.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant