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

Adding sub total and sorting capabilities #34

Merged
merged 3 commits into from
Mar 10, 2022
Merged

Conversation

slevertbiot
Copy link

No description provided.

@@ -20,11 +20,16 @@ export class MongoDeviceDAO implements DeviceDAO {
.toArray();
}

async getFilteredDeviceCount(searchOptions: SearchOptions): Promise<number> {
// console.log(await this.db.collection<Device>('device').countDocuments());
Copy link
Author

Choose a reason for hiding this comment

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

will remove this

@@ -5,11 +5,16 @@ export function getFilter(jsonFilters: Filter[]): any {
const mongoFilters: any = {};

jsonFilters.forEach((filter) => {
if (filter.field === 'operational') {
}
// '~' is our symbol for 'contains'
// the operational field is a boolean so do not try a partial match on this field
Copy link
Author

Choose a reason for hiding this comment

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

going to clean up these docs

jest.resetAllMocks();
jest.restoreAllMocks();

// jest.resetAllMocks();

Choose a reason for hiding this comment

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

Can remove comments.

@@ -13,6 +13,7 @@ const QUERY_DEVICES = gql`
query {
devices(searchOptions: { batchSize: 10, offset: 10, sortOptions: { direction: DESC, field: "name" }, filter: "" }) {
totalCount
totalFilteredCount

Choose a reason for hiding this comment

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

:)

@@ -43,8 +45,8 @@ beforeEach(async () => {
afterEach(async () => {
await db.collection('device').deleteMany({});

// jest.resetAllMocks();
// jest.restoreAllMocks();
jest.resetAllMocks();

Choose a reason for hiding this comment

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

u ended up needing these?

@slevertbiot slevertbiot merged commit c544554 into master Mar 10, 2022
@slevertbiot slevertbiot deleted the sorting-and-sub-total branch August 4, 2022 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants