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

Added ability to add parentId into api calls #52

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jamieDavisOneBeyond
Copy link
Contributor

Should allow parentId by default on our grids so that if you're needing to grab data with a parentId filter..
We already provide a parentId in our API but never added it as a query parameter.

Should look something like this:

  onBeforeMount(() => {
    entityGrid.initDataAdaptor(entityApiClient.apiUrl, onError, <parentId>);
  });

Description

Added the ability to use parentId in UI

Motivation and Context

Solves API being allowed to use parentId query parameter but Vuetify / Obelisk UI by default not having a parentId

@@ -21,6 +23,10 @@ export class DataAdaptor extends ObApiClient {
filters.push(`limit=${query.limit}`);
filters.push(this.constructSortQuery(query.orderBy));

if (this._parentId) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the syncfusion front-end, the executeApi is more complex and with more parameters. Why can't we do this here? Why can't parentId be an optional parameter to pass to executeApi instead of being passed in the ctor?

image

@@ -4,9 +4,11 @@ import type { Query, OrderBy } from "@js/grids/vuetify/types";

export class DataAdaptor extends ObApiClient {
private readonly errorCallback: Function;
private readonly _parentId?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The underscore for private fields is an outdated convention...
It should be used only in case of possible member conflict:

https://stackoverflow.com/questions/47747809/typescript-underscore-convention-for-members
https://www.typescriptlang.org/docs/handbook/2/classes.html#private

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

Successfully merging this pull request may close these issues.

2 participants