此代码用于将用户添加到数据库
export const addUserInDB = (userEntityModel: UserEntityModel) => {
userEntityModel.id = '7';
return fetch(usersUrl, {
method: 'POST',
body: JSON.stringify(userEntityModel),
}).then((res) => res.json());
};
但它只在数据库中返回此代码
{
"id": "Tcvpety"
}
我想要这样的东西
{
"id": "5",
"login": "luigi",
"password": "luigi125",
"email": "lluis.rubies@test.com",
"country": "Japan",
"type": "Customer",
"language": [
"Japanese",
"English"
]
},