Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to log values of populating ? #232

Open
lephuocson1999 opened this issue Nov 3, 2020 · 0 comments
Open

How to log values of populating ? #232

lephuocson1999 opened this issue Nov 3, 2020 · 0 comments

Comments

@lephuocson1999
Copy link

lephuocson1999 commented Nov 3, 2020

My populates setting:

settings: {
	populates: {
			category: {
				action: "categories.get",
				params: {
					fields: ["name"],
					// populates: ["category"]
				}
			},
		},
},

My actions code:

findByID: {
			rest: "GET /:id",
			params:{
				id: "string"
			},
			async handler(ctx) {
				let id = ctx.params.id;

				let infoProduct = await this.adapter.findById(id);

				return this.transformDocuments(ctx, {populate: ["category"]}, infoProduct);
			}
		}

My terminals response:

action 'products.findByID'
└─── action 'categories.get' *

Response:
{
_id: '5f9a9417de47ec3ad48941bb',
name: 'Missout Out 3',
price: 300000,
amout: 20,
status: 0
}

Why do category can not log out eventhough action “categories get” is made?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant