fixing 12 gauge format
This commit is contained in:
+18
-3
@@ -117,7 +117,7 @@ const pool = databaseUrl
|
|||||||
password: postgresPassword,
|
password: postgresPassword,
|
||||||
});
|
});
|
||||||
|
|
||||||
const defaultCalibers = ['9mm', '.22 LR', '5.56 NATO', '.308 Win', '12 Gauge - Birdshot', '12 Gauge - Buckshot', '12 Gauge - Slug', '12 Gauge Sporting', '.45 ACP'];
|
const defaultCalibers = ['9mm', '.22 LR', '5.56 NATO', '.308 Win', '12 Gauge - Birdshot', '12 Gauge - Buckshot', '12 Gauge - Slug', '12 Gauge - Sporting', '.45 ACP'];
|
||||||
const firearmCategories = ['Handgun', 'Rifle', 'Shotgun', 'PCC', 'Other'];
|
const firearmCategories = ['Handgun', 'Rifle', 'Shotgun', 'PCC', 'Other'];
|
||||||
const sessionHours = 24 * 7;
|
const sessionHours = 24 * 7;
|
||||||
|
|
||||||
@@ -386,7 +386,7 @@ const ensureSchema = async () => {
|
|||||||
const ensureProfileDefaults = async (profileId: string) => {
|
const ensureProfileDefaults = async (profileId: string) => {
|
||||||
await pool.query(
|
await pool.query(
|
||||||
`UPDATE calibers
|
`UPDATE calibers
|
||||||
SET name = '12 Gauge Sporting',
|
SET name = '12 Gauge - Sporting',
|
||||||
is_default = TRUE
|
is_default = TRUE
|
||||||
WHERE profile_id = $1
|
WHERE profile_id = $1
|
||||||
AND name = '12 Gauge'
|
AND name = '12 Gauge'
|
||||||
@@ -394,7 +394,22 @@ const ensureProfileDefaults = async (profileId: string) => {
|
|||||||
SELECT 1
|
SELECT 1
|
||||||
FROM calibers existing
|
FROM calibers existing
|
||||||
WHERE existing.profile_id = $1
|
WHERE existing.profile_id = $1
|
||||||
AND existing.name = '12 Gauge Sporting'
|
AND existing.name = '12 Gauge - Sporting'
|
||||||
|
)`,
|
||||||
|
[profileId],
|
||||||
|
);
|
||||||
|
|
||||||
|
await pool.query(
|
||||||
|
`UPDATE calibers
|
||||||
|
SET name = '12 Gauge - Sporting',
|
||||||
|
is_default = TRUE
|
||||||
|
WHERE profile_id = $1
|
||||||
|
AND name = '12 Gauge Sporting'
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM calibers existing
|
||||||
|
WHERE existing.profile_id = $1
|
||||||
|
AND existing.name = '12 Gauge - Sporting'
|
||||||
)`,
|
)`,
|
||||||
[profileId],
|
[profileId],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -117,8 +117,8 @@ const ammoPageSelectionKey = 'arsenal-iq-ammo-page-calibers';
|
|||||||
const ammoPageSelectionMigrationKey = 'arsenal-iq-ammo-page-calibers-v2';
|
const ammoPageSelectionMigrationKey = 'arsenal-iq-ammo-page-calibers-v2';
|
||||||
const firearmCategories = ['Handgun', 'Rifle', 'Shotgun', 'PCC', 'Other'];
|
const firearmCategories = ['Handgun', 'Rifle', 'Shotgun', 'PCC', 'Other'];
|
||||||
const allFirearmCategoriesLabel = 'All categories';
|
const allFirearmCategoriesLabel = 'All categories';
|
||||||
const defaultCaliberNames = ['9mm', '.22 LR', '5.56 NATO', '.308 Win', '12 Gauge - Birdshot', '12 Gauge - Buckshot', '12 Gauge - Slug', '12 Gauge Sporting', '.45 ACP'];
|
const defaultCaliberNames = ['9mm', '.22 LR', '5.56 NATO', '.308 Win', '12 Gauge - Birdshot', '12 Gauge - Buckshot', '12 Gauge - Slug', '12 Gauge - Sporting', '.45 ACP'];
|
||||||
const boxTrackedCalibers = ['12 Gauge Sporting'];
|
const boxTrackedCalibers = ['12 Gauge - Sporting'];
|
||||||
|
|
||||||
const currency = new Intl.NumberFormat('en-US', {
|
const currency = new Intl.NumberFormat('en-US', {
|
||||||
style: 'currency',
|
style: 'currency',
|
||||||
|
|||||||
Reference in New Issue
Block a user