Skip to content

Commit

Permalink
Fix api_set_context migration.
Browse files Browse the repository at this point in the history
Fix non-unique key code smell.
  • Loading branch information
NickPhura committed Dec 9, 2023
1 parent 0d2cf68 commit 433f19a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/features/surveys/components/SamplingMethodForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const SamplingMethodForm = () => {
)}
<Stack component={TransitionGroup} gap={1.5}>
{values.methods.map((item, index) => (
<Collapse key={`sample_method_${item.method_lookup_id}_${item.periods.length}`}>
<Collapse key={`sample_method_${item.method_lookup_id || Math.random()}`}>
<Card
variant="outlined"
sx={{
Expand Down Expand Up @@ -189,7 +189,7 @@ const SamplingMethodForm = () => {
<List dense disablePadding>
{item.periods.map((period) => (
<ListItem
key={`sample_period_${period.survey_sample_period_id}`}
key={`sample_period_${period.survey_sample_period_id || Math.random()}`}
divider
disableGutters
sx={{ pl: 1.25 }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { Knex } from 'knex';
*/
export async function up(knex: Knex): Promise<void> {
await knex.raw(`
SET search_path = 'biohub';
DROP FUNCTION IF EXISTS api_set_context;
CREATE OR REPLACE FUNCTION api_set_context(p_system_user_guid system_user.user_guid%type, p_user_identity_source_name user_identity_source.name%type) RETURNS system_user.system_user_id%type
Expand Down

0 comments on commit 433f19a

Please sign in to comment.