feat(api): public good detail family block behind gray-release flag
This commit is contained in:
@@ -122,11 +122,17 @@ export class GoodsService {
|
||||
);
|
||||
await this.ensureMergedOriginGoods(mergedIds);
|
||||
const result = await this.prisma.$transaction(async (tx) => {
|
||||
// Good 的族是派生数据:主链接所属族
|
||||
const primary = await tx.originGood.findUnique({
|
||||
where: { id: BigInt(dto.originGoodId) },
|
||||
select: { familyId: true },
|
||||
});
|
||||
const created = await tx.good.create({
|
||||
data: {
|
||||
goodName: dto.goodName,
|
||||
goodImage: dto.goodImage,
|
||||
originGoodId: BigInt(dto.originGoodId),
|
||||
familyId: primary?.familyId ?? null,
|
||||
countryId: BigInt(dto.countryId),
|
||||
categoryId: BigInt(dto.categoryId),
|
||||
positionId: dto.positionId === undefined ? null : BigInt(dto.positionId),
|
||||
@@ -217,6 +223,7 @@ export class GoodsService {
|
||||
const good = await tx.good.create({
|
||||
data: {
|
||||
originGoodId: originGood.id,
|
||||
familyId: family?.id ?? null,
|
||||
countryId: BigInt(dto.countryId),
|
||||
categoryId: BigInt(dto.categoryId),
|
||||
positionId:
|
||||
@@ -445,6 +452,7 @@ export class GoodsService {
|
||||
goodName: og.goodName ?? `Origin Good ${og.sdsGoodId}`,
|
||||
goodImage: og.goodImage,
|
||||
originGoodId: og.id,
|
||||
familyId: og.familyId,
|
||||
countryId: BigInt(dto.countryId),
|
||||
categoryId: BigInt(dto.categoryId),
|
||||
positionId: dto.positionId === undefined ? null : BigInt(dto.positionId),
|
||||
|
||||
Reference in New Issue
Block a user