How Sequelize saves two tables at a time

clipboard.png

as shown in the figure, Table 1 is associated with Table 2. How to click submit and save the two tables together


Front

axios.post('/post',{data:1,data2:2});

backend (KOA, for example, requires koa-bodyparser middleware)

const {data,data2} = ctx.request.body;
const [model,model2] = await Promise.all([Model.create(data),Model2.create(data2)]);
Menu