mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-19 00:30:56 +00:00
fix: project environment positions
This commit is contained in:
@@ -65,10 +65,16 @@ export const projectEnvDALFactory = (db: TDbClient) => {
|
||||
}
|
||||
};
|
||||
|
||||
const shiftPositions = async (projectId: string, pos: number, tx?: Knex) => {
|
||||
// Shift all positions >= the new position up by 1
|
||||
await (tx || db)(TableName.Environment).where({ projectId }).where("position", ">=", pos).increment("position", 1);
|
||||
};
|
||||
|
||||
return {
|
||||
...projectEnvOrm,
|
||||
findBySlugs,
|
||||
findLastEnvPosition,
|
||||
updateAllPosition
|
||||
updateAllPosition,
|
||||
shiftPositions
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user