Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bhollis committed May 21, 2024
1 parent 7f5d7c2 commit 4a62093
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/db/searches-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export async function updateUsedSearch(
text: `insert INTO searches (membership_id, destiny_version, query, search_type, created_by, last_updated_by)
values ($1, $2, $3, $5, $4, $4)
on conflict (membership_id, destiny_version, qhash)
do update set (usage_count, last_used, last_updated_at, last_updated_by) = (searches.usage_count + 1, current_timestamp, current_timestamp, $5, $4)`,
do update set (usage_count, last_used, last_updated_at, last_updated_by) = (searches.usage_count + 1, current_timestamp, current_timestamp, $4)`,
values: [bungieMembershipId, destinyVersion, query, appId, type],
});

Expand Down
4 changes: 4 additions & 0 deletions api/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { GlobalSettings } from './shapes/global-settings.js';
import { LoadoutShareRequest } from './shapes/loadout-share.js';
import { Loadout, LoadoutItem } from './shapes/loadouts.js';
import { ProfileResponse, ProfileUpdateRequest } from './shapes/profile.js';
import { SearchType } from './shapes/search.js';
import { defaultSettings } from './shapes/settings.js';

const request = supertest(app);
Expand Down Expand Up @@ -891,6 +892,7 @@ describe('searches', () => {
action: 'search',
payload: {
query: 'tag:favorite',
type: SearchType.Item,
},
},
],
Expand Down Expand Up @@ -920,12 +922,14 @@ describe('searches', () => {
action: 'search',
payload: {
query: 'tag:favorite',
type: SearchType.Item,
},
},
{
action: 'save_search',
payload: {
query: 'tag:favorite',
type: SearchType.Item,
saved: true,
},
},
Expand Down

0 comments on commit 4a62093

Please sign in to comment.