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

Fix bug with /api/assets?type=request&search= #361

Open
marvinsjsu opened this issue Jul 20, 2023 · 1 comment · May be fixed by #380
Open

Fix bug with /api/assets?type=request&search= #361

marvinsjsu opened this issue Jul 20, 2023 · 1 comment · May be fixed by #380
Assignees
Labels
Back End bug Something isn't working

Comments

@marvinsjsu
Copy link
Contributor

marvinsjsu commented Jul 20, 2023

When going to /search-results?category=Needs, we get an error regarding assets.map. We have a ticket to take care of the frontend, but we need to look into the corresponding API call, GET on /api/assets?type=request&search=. The request is causing a 500 error.

Error log from /server:

error: error: column Asset.searchtitle does not exist
[Nest] 14710  - 07/19/2023, 9:53:44 PM   ERROR [ExceptionsHandler] column Asset.searchtitle does not exist
QueryFailedError: column Asset.searchtitle does not exist
    at PostgresQueryRunner.query (/Users/marvinmante/Projects/web-app/server/src/driver/postgres/PostgresQueryRunner.ts:299:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at SelectQueryBuilder.loadRawResults (/Users/marvinmante/Projects/web-app/server/src/query-builder/SelectQueryBuilder.ts:3789:25)
    at SelectQueryBuilder.executeEntitiesAndRawResults (/Users/marvinmante/Projects/web-app/server/src/query-builder/SelectQueryBuilder.ts:3541:26)
    at SelectQueryBuilder.getRawAndEntities (/Users/marvinmante/Projects/web-app/server/src/query-builder/SelectQueryBuilder.ts:1670:29)
    at SelectQueryBuilder.getMany (/Users/marvinmante/Projects/web-app/server/src/query-builder/SelectQueryBuilder.ts:1760:25)
    at /Users/marvinmante/Projects/web-app/server/node_modules/@nestjs/core/router/router-execution-context.js:46:28
    at /Users/marvinmante/Projects/web-app/server/node_modules/@nestjs/core/router/router-proxy.js:9:17
[Nest] 14710  - 07/19/2023, 9:53:44 PM     LOG [HTTP] GET /api/assets?type=request&search= 500 52 - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Error on dev console:

Image

Related to https://github.com/orgs/Nonprofit-Exchange-Hub/projects/14/views/1?pane=issue&itemId=33627395

@marvinsjsu marvinsjsu added bug Something isn't working Back End labels Jul 20, 2023
@taoliu12 taoliu12 self-assigned this Aug 12, 2023
@marvinsjsu
Copy link
Contributor Author

hi @taoliu12, I think in our last dev sync-up (and if I remember correctly) you mentioned that we just needed to seed data and this will fix the issue, but I was wondering if it'd still be good to have a fix so that even if we didn't have any request type of asset, we wouldn't error out.

@taoliu12 taoliu12 linked a pull request Oct 14, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Back End bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants