diff --git a/packages/app-api/src/service/Shop/dto.ts b/packages/app-api/src/service/Shop/dto.ts index f7346b4965..ac3d5bf533 100644 --- a/packages/app-api/src/service/Shop/dto.ts +++ b/packages/app-api/src/service/Shop/dto.ts @@ -45,8 +45,7 @@ export class ShopListingOutputDTO extends TakaroModelDTO { @IsNumber() price!: number; @IsString() - @IsOptional() - name?: string; + name: string; @IsISO8601() @IsOptional() deletedAt?: Date; @@ -63,8 +62,7 @@ export class ShopListingCreateDTO extends TakaroDTO { @IsNumber() price!: number; @IsString() - @IsOptional() - name?: string; + name: string; @IsBoolean() @IsOptional() draft?: boolean; diff --git a/packages/lib-apiclient/src/generated/api.ts b/packages/lib-apiclient/src/generated/api.ts index 67302b29d1..624664b890 100644 --- a/packages/lib-apiclient/src/generated/api.ts +++ b/packages/lib-apiclient/src/generated/api.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 79d1da12fecd3c58d8d51f65aa8e58e2473d1694 + * The version of the OpenAPI document: development - 89afe913b9508ea5a7464ac1d009d207112df754 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -7944,7 +7944,7 @@ export interface ShopListingCreateDTO { * @type {string} * @memberof ShopListingCreateDTO */ - name?: string; + name: string; /** * * @type {boolean} @@ -8074,7 +8074,7 @@ export interface ShopListingOutputDTO { * @type {string} * @memberof ShopListingOutputDTO */ - name?: string; + name: string; /** * * @type {NOTDOMAINSCOPEDTakaroModelDTOCreatedAt} diff --git a/packages/lib-apiclient/src/generated/base.ts b/packages/lib-apiclient/src/generated/base.ts index 5916061071..4a0b52ef24 100644 --- a/packages/lib-apiclient/src/generated/base.ts +++ b/packages/lib-apiclient/src/generated/base.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 79d1da12fecd3c58d8d51f65aa8e58e2473d1694 + * The version of the OpenAPI document: development - 89afe913b9508ea5a7464ac1d009d207112df754 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-apiclient/src/generated/common.ts b/packages/lib-apiclient/src/generated/common.ts index d6f7c304d6..b4ced1a27e 100644 --- a/packages/lib-apiclient/src/generated/common.ts +++ b/packages/lib-apiclient/src/generated/common.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 79d1da12fecd3c58d8d51f65aa8e58e2473d1694 + * The version of the OpenAPI document: development - 89afe913b9508ea5a7464ac1d009d207112df754 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-apiclient/src/generated/configuration.ts b/packages/lib-apiclient/src/generated/configuration.ts index ea20f2348f..90fa04225a 100644 --- a/packages/lib-apiclient/src/generated/configuration.ts +++ b/packages/lib-apiclient/src/generated/configuration.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 79d1da12fecd3c58d8d51f65aa8e58e2473d1694 + * The version of the OpenAPI document: development - 89afe913b9508ea5a7464ac1d009d207112df754 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-apiclient/src/generated/index.ts b/packages/lib-apiclient/src/generated/index.ts index 7380a7acb5..de30ed05f9 100644 --- a/packages/lib-apiclient/src/generated/index.ts +++ b/packages/lib-apiclient/src/generated/index.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 79d1da12fecd3c58d8d51f65aa8e58e2473d1694 + * The version of the OpenAPI document: development - 89afe913b9508ea5a7464ac1d009d207112df754 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-db/src/migrations/sql/20241020133133-make-listing-name-required.ts b/packages/lib-db/src/migrations/sql/20241020133133-make-listing-name-required.ts new file mode 100644 index 0000000000..feab53a082 --- /dev/null +++ b/packages/lib-db/src/migrations/sql/20241020133133-make-listing-name-required.ts @@ -0,0 +1,16 @@ +import { Knex } from 'knex'; + +export async function up(knex: Knex): Promise { + // Set all listings w/o name to 'Unnamed' + await knex('shopListing').whereNull('name').update({ name: 'Unnamed' }); + + await knex.schema.alterTable('shopListing', (table) => { + table.string('name').notNullable().alter(); + }); +} + +export async function down(knex: Knex): Promise { + await knex.schema.alterTable('shopListing', (table) => { + table.string('name').nullable().alter(); + }); +} diff --git a/packages/lib-gameserver/src/gameservers/7d2d/index.ts b/packages/lib-gameserver/src/gameservers/7d2d/index.ts index 625eda91c7..4eb1805163 100644 --- a/packages/lib-gameserver/src/gameservers/7d2d/index.ts +++ b/packages/lib-gameserver/src/gameservers/7d2d/index.ts @@ -100,7 +100,7 @@ export class SevenDaysToDie implements IGameServer { async giveItem(player: IPlayerReferenceDTO, item: string, amount: number = 1, quality?: string): Promise { const command = this.connectionInfo.useCPM - ? `giveplus EOS_${player.gameId} ${item} ${amount} ${quality ?? ''} 0` + ? `giveplus EOS_${player.gameId} ${item} ${amount} ${quality ? quality + ' 0' : ''}` : `give EOS_${player.gameId} ${item} ${amount} ${quality ?? ''}`; const res = await this.executeConsoleCommand(command); diff --git a/packages/web-main/src/routes/_auth/gameserver.$gameServerId/shop.listing.create.tsx b/packages/web-main/src/routes/_auth/gameserver.$gameServerId/shop.listing.create.tsx index 507f4afcd9..817720cddd 100644 --- a/packages/web-main/src/routes/_auth/gameserver.$gameServerId/shop.listing.create.tsx +++ b/packages/web-main/src/routes/_auth/gameserver.$gameServerId/shop.listing.create.tsx @@ -40,7 +40,7 @@ function Component() { const onSubmit: SubmitHandler = ({ name, items, price, draft }) => { mutate({ - name: name ? name : undefined, + name: name ? name : 'Unnamed', price, gameServerId, items,