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

How to do a search for hardware ticket by ticket number? #29

Open
perlDreamer opened this issue Nov 6, 2024 · 4 comments
Open

How to do a search for hardware ticket by ticket number? #29

perlDreamer opened this issue Nov 6, 2024 · 4 comments
Assignees

Comments

@perlDreamer
Copy link

In the db, the id an integer. In the JS object, it's a vNumber. Also, you can't filter by id because it's not filterable in the baseSchema.

@perlDreamer
Copy link
Author

Note, I fixed the jump to ticket by ticket number using a custom route, so this ticket is about understanding how to do this.

@rizen
Copy link
Member

rizen commented Nov 22, 2024

depends upon this getting fixed: plainblack#203

@rizen
Copy link
Member

rizen commented Jan 13, 2025

Fixed.

For your specific use case there's a few things to note:

First, you'll need to upgrade to the latest ving, which includes updating your schemas per the notes in the change log.

Second, you'll need to add allowRealPubicId to the id field like: { ...baseSchemaId, filterQuery: true, allowRealPubicId: true },

Third, you no longer need to expose ticketNumber via meta manually as that is done automatically once you set allowRealPubicId to true. It does this by adding a realId property to meta and in there you'll get id. So to access it you'd be doing hardwareticket.meta.realId.id instead of hardwareticket.meta.ticketNumber. This mechanism allows you to expose lots of different id's as real numbers in case that's important, though obviously that isn't important in this case. Just trying to future proof.

You also don't need a custom route anymore. Once you set up allowRealPubicId you'll be able to use the built in filtering mechanism by just adding search=4 or whatever to your URL.

@rizen rizen closed this as completed Jan 13, 2025
@rizen
Copy link
Member

rizen commented Jan 13, 2025

Oops. I suppose I shouldn't have closed this since you haven't implemented it yet

@rizen rizen reopened this Jan 13, 2025
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

2 participants