update
This commit is contained in:
parent
de847ce7cb
commit
481bab8c17
File diff suppressed because one or more lines are too long
|
|
@ -136,6 +136,8 @@ const chooseLocation = async (
|
|||
const container = await thiefService.getElementByXPath(xpaths.container);
|
||||
if (!container) throw new Error("Container xpath not found");
|
||||
|
||||
thiefService.scrollToElement(container);
|
||||
|
||||
// Tìm phần tử con có nội dung giống value
|
||||
const matchingChild = Array.from(container.children).find((child) =>
|
||||
child.textContent
|
||||
|
|
@ -216,54 +218,54 @@ const handle = async (item: IItem) => {
|
|||
// B1. Upload images
|
||||
await uploadImages(item);
|
||||
|
||||
await delay(200);
|
||||
await delay(400);
|
||||
// B2. Write title
|
||||
thiefService.writeToInput(item.title, selectors.title_input);
|
||||
|
||||
await delay(200);
|
||||
await delay(400);
|
||||
// B3. Write price
|
||||
thiefService.writeToInput(String(item.price), selectors.price_input);
|
||||
|
||||
await delay(200);
|
||||
await delay(400);
|
||||
// B4. Select category
|
||||
await chooseSelect(item.category, selectors.category_select);
|
||||
|
||||
await delay(200);
|
||||
await delay(400);
|
||||
// B5. Select condition
|
||||
await chooseSelect(item.condition, selectors.condition_select);
|
||||
|
||||
if (item.brand) {
|
||||
await delay(200);
|
||||
await delay(400);
|
||||
// B3. Write price
|
||||
thiefService.writeToInput(item.brand, selectors.brand_input);
|
||||
}
|
||||
|
||||
await delay(200);
|
||||
await delay(400);
|
||||
// B3. Write price
|
||||
await thiefService.writeToInput(
|
||||
item.description,
|
||||
selectors.description_input
|
||||
);
|
||||
|
||||
await delay(200);
|
||||
await delay(400);
|
||||
|
||||
await writeTags(item.tags, selectors.tags_input);
|
||||
|
||||
await delay(200);
|
||||
await delay(400);
|
||||
// B3. Write price
|
||||
thiefService.writeToInput(item.sku, selectors.sku_input);
|
||||
|
||||
if (item?.location) {
|
||||
await delay(200);
|
||||
await delay(400);
|
||||
|
||||
await chooseLocation(item.location, selectors.location_select);
|
||||
}
|
||||
|
||||
await delay(200);
|
||||
await delay(400);
|
||||
|
||||
await clickNext();
|
||||
|
||||
// await delay(200);
|
||||
// await delay(400);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ export default function List() {
|
|||
displayType: "custom",
|
||||
render: (value, row) => {
|
||||
if (!row.tags.length) {
|
||||
return <Badge variant={"secondary"}>Chưa có vai trò</Badge>;
|
||||
return <Badge variant={"secondary"}>No tags</Badge>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 350 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 972 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 994 KiB |
|
|
@ -10,6 +10,8 @@ export class PublistHistory extends CoreEntity {
|
|||
@Column({ type: 'bool' })
|
||||
published: boolean;
|
||||
|
||||
@ManyToOne(() => Product, (product) => product.histories)
|
||||
@ManyToOne(() => Product, (product) => product.histories, {
|
||||
onDelete: 'CASCADE', // hoặc 'SET NULL' tùy mục đích
|
||||
})
|
||||
product: Product;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,6 @@ export class ProductsService extends CoreService<Product> {
|
|||
// Đợi phản hồi từ client
|
||||
const publistResult = await this.waitForPublistResult(plainData);
|
||||
|
||||
console.log({ publistResult });
|
||||
if (!publistResult.published) {
|
||||
throw new BadRequestException(
|
||||
AppResponse.toResponse(null, {
|
||||
|
|
@ -169,7 +168,6 @@ export class ProductsService extends CoreService<Product> {
|
|||
|
||||
const result = await this.historiesRepo.save({ ...data, product });
|
||||
|
||||
console.log({ result });
|
||||
this.eventService.sendEvent(
|
||||
`${ProductsService.EVENTS.PUBLIST_FINISH}_${plainData.id}`,
|
||||
plainToClass(PublistHistory, result),
|
||||
|
|
|
|||
Loading…
Reference in New Issue