Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 16:43
    uniconstructor edited #4126
  • Jan 31 16:41
    uniconstructor edited #4126
  • Jan 31 16:41
    uniconstructor opened #4126
  • Jan 31 03:44
    dzungh0ang closed #4123
  • Jan 30 00:25
    techaks closed #4125
  • Jan 30 00:02
    techaks edited #4125
  • Jan 30 00:01
    techaks opened #4125
  • Jan 29 23:33
    jkpulido opened #4124
  • Jan 29 13:32
    nabdelgadir closed #4114
  • Jan 29 09:17

    bajtos on add-node10

    (compare)

  • Jan 29 07:13
    dzungh0ang opened #4123
  • Jan 29 04:25
    dhmlau closed #3881
  • Jan 28 13:14
    bajtos edited #4119
  • Jan 28 12:47
    bajtos labeled #4121
  • Jan 28 12:46
    bajtos labeled #4118
  • Jan 28 12:46
    bajtos labeled #4118
  • Jan 28 12:46
    bajtos labeled #4118
  • Jan 28 12:46
    bajtos assigned #4118
  • Jan 25 19:50
    dhmlau closed #3906
  • Jan 25 19:13
    mschnee synchronize #4119
Darko Damljanović
@darko.damljanovic1_gitlab
Is there any way to make transaction for multiple database inserts? If there is possibility, how to implement it?
Darko Damljanović
@darko.damljanovic1_gitlab
@bajtos If we want to make transactions using multiple entities and their repositories, do we have to extend "DefaultTransactionalRepository" on every repository that is going to be a part of a transation?
Darko Damljanović
@darko.damljanovic1_gitlab
@mamiller93 Unfortunately no. Although, I was somewhat successful to separate OpenApi3 specs to another file using namespaces. I had to make RequestBody and ResponseObject separately and map them within "@operation()" decorator of a controller.
Rafaël Sarrechia
@Rsarrechia
is there any documentation on how to integrate facebook authentication into Loopback4 ? #loopback4 #loobackjs
Hassan Ahmed
@hasanzia1993_gitlab
Hi everyone, i have a question regarding embedsOne in loopback3 relationships. Consider the example here : https://loopback.io/doc/en/lb3/Embedded-models-and-relations.html
it has embedsMany with scope to include and it works fine but if it's embedsOne type then the include does not work. Any idea how to fix it or workaround?
"relations": {

    "people": {

      "type": "embedsMany",

      "model": "Link",

      "scope": {

        "include": "linked"

      }

    }

  }
Eduardo Mazzucchelli
@emazzu

hi people, how are you ??
what node component I need, for save the log in txt file, or database ??
loopback has something incluid for this ??

Regards
Eduardo

Edwin Zhao
@ezhao7

Hi all, I'm trying to make some POST and GET requests to Google API, but I keep getting an unhandled error " 500 TypeError: Cannot initialize connector "rest": Cannot read property 'root' of undefined

Is this the case where my JSON file is written incorrectly?

I'm also unclear on where Google AUTH key would go into the JSON file here
Edwin Zhao
@ezhao7
This error seems to appear when I have a parameter in a function call for any request. What would be the correct formatting?

controller.ts

  //ts-lint:disable-next-line: no-any
  async getDetails(): Promise<any> {
    return await this.apiService.getDetails('authToken');
  }

api.service.ts > interface
getDetails(apiKey: string): Promise<any>;

api.datasource.json

"operations": [{
    "template": {
      "method": "GET",
      "url": "https://mybusiness.googleapis.com/v4/accounts"
    },
    "functions": {
      "getDetails": ["authToken"]
    }
  }
This is somewhat what the code looks like. appreciate any help!
lakinmohapatra
@lakinmohapatra
Hi Guys

I have an user model which has following relation with address table .

@hasMany(() => UserAddress) addresses?: UserAddress[];

But in api explorer , its not showing any fields for entering address details for user controller .

Any suggestions on above will be greatly appreciated
Nico Flaig
@nflaig
@lakinmohapatra it is a relation not part of the user model itself. Take a look at the docs https://loopback.io/doc/en/lb4/HasMany-relation.html
Pradeep Kumar Tippa
@pktippa

In LoopBack 4, What is the right place to perform data transformation, Ex: converting all the snake case keys coming from datasource to camel case sending as REST response.?

@bajtos @dhmlau

Taskhyn Maksim
@sarbazx
how to use LoopBack 4 without typescript but just with ES06?
Darko Damljanović
@darko.damljanovic1_gitlab
@pktippa You need to confirm this, but Sequence or Interceptors sounds good. I think they act as a replacement for good old Express Middlewares we have been use to 😊
@bajtos Are there any words regarding postgresql support for foreign keys in either model or property decorator? We now have weak links, but we cannot use ER diagram to inspect database relationship at this point.
Reza
@rsa408
hi guys i have getting this error when using lb4 with mongodb:
{
"error": {
"statusCode": 422,
"name": "UnprocessableEntityError",
"message": "The request body is invalid. See error object details property for more info.",
"code": "VALIDATION_FAILED",
"details": [
{
"path": "",
"code": "not",
"message": "should NOT be valid",
"info": {}
}
]
}
}
with memory DB there is no issue but when adding MongoDB post API is making issue as I post above.
Warman Suganda
@warmansuganda
hi, how to defining custom keywords? i need add AJV keyword for Asynchronous validation in some controllers.
Ahmad Ali
@byAhmadAli
hello any example how to make live location in lp4 ?
liyunfei
@liyunfei_gitlab
nobady?
where is strong-pm workspace?
Eduardo Mazzucchelli
@emazzu

hi people, do you know about this error ???

"name": "wellnotes",
"options": {
"idInjection": false,
"mssql": {
"schema": "dbo",
"table": "wellNotes"
}
},
"properties": {
"id": {
"type": "Number",
"required": true,
"length": null,
"precision": 10,
"scale": 0,
"id": 1,
"mssql": {

"error": {
"statusCode": 404,
"name": "Error",
"message": "Unknown \"wellnotes\" id \"undefined\".",
"status": 404,
"code": "MODEL_NOT_FOUND",
"stack": "Error: Unknown \"wellnotes\" id \"undefined\".\n at new Error (native)\n at Function.convertNullToNotFoundError

sertal70
@sertal70
Hi all, I'm working with lb4 and I need to use the MongoDB $unsetextended operator. Documentation on MongoDB connector indirectly states that they can be used (see here) , but I can't find any example on how should I use them on my repository, do you have any hints?
Eduardo Mazzucchelli
@emazzu

hi people, how are you ?

what can be, the relations propoeties works with BelongsTo, but not with hasMany

"relations": {
"cat": {
"type": "hasMany",
"model": "wnCategories",
"foreignKey": "idCategory",
"primaryKey": "id"
},
"ss": {
"type": "hasMany",
"model": "wnStatusSituations",
"foreignKey": "idSituationStatus",
"primaryKey": "id"
}
}

with hasMany, says:
"originalError": {
"info": {
"number": 207,
"state": 1,
"class": 16,
"message": "Invalid column name 'idCategory'.",
"serverName": "sqlaas01d-e1-sinopecarg",
"procName": "",
"lineNumber": 1,
"name": "ERROR",
"event": "errorMessage"
}
},

the category, exists.

"idCategory": {
"type": "Number",
"required": true,
"length": null,
"precision": 10,
"scale": 0,
"mssql": {
"columnName": "idCategory",
"dataType": "int",
"dataLength": null,
"dataPrecision": 10,
"dataScale": 0,
"nullable": "NO"
}
},

Asjad ® 🤷🏻‍♂️
@ChAsjadMahmood3_twitter
Hi , usually when you create model it maps exactly in the postgresql. but when i use relations in lb4 i.e @hasmany etc it has no effect on postgresql database sql. Even when i create arrays in lb4 as proposed in the docs no changes happen in the sql when i see it in pgadmin.
secondly is their any way you can use sql complex queries like( group by queries ) to work in lb4
William Ondenge
@wondenge
{ "cardAcceptor": { "address": { "city": "Foster City", "country": "RU", "county": "San Mateo", "state": "CA", "zipCode": "94404" }, "idCode": "ABCD1234ABCD123", "name": "ABCD", "terminalId": "ABCD1234" }, "destinationCurrencyCode": "840", "markUpRate": "1", "retrievalReferenceNumber": "201010101031", "sourceAmount": "100", "sourceCurrencyCode": "643", "systemsTraceAuditNumber": "350421" }

{ "cardAcceptor": { "address": { "city": "Foster City", "country": "RU", "county": "San Mateo", "state": "CA", "zipCode": "94404" }, "idCode": "ABCD1234ABCD123", "name": "ABCD", "terminalId": "ABCD1234" }, "destinationCurrencyCode": "840", "markUpRate": "1", "retrievalReferenceNumber": "201010101031", "sourceAmount": "100", "sourceCurrencyCode": "643", "systemsTraceAuditNumber": "350421" }

Any advice how I can represent this using an lb4 model command on the cli? Or other workarounds with nested objects. Thanks

Scott Switzer
@switzer
Hi! I am trying to create a SOAP request with the following format: {parentnode: childnode: {$attributes: {ID: 1}, childnode{$attributes: {ID: 2}}
The resulting SOAP request only includes the last childnode - e.g. looks like since both child nodes are named the same thing, the second one overwrites the first.
I tried to put the child nodes into an array, but that does not work either
Does anyone have advice for me? I looked through all of the tests, and this case does not seem to be covered
BTW - using the strong-soap Node module
Scott Switzer
@switzer
Um - sorted it out. {parent node: childnode: [a,b]}
Diana Lau
@dhmlau
@wondenge , when creating the cardAcceptor model, you can specify type "object" as address. In the generated typescript class, you can:
@property()
address?: Address;
Francisco Buceta
@frbuceta
Hey, how are you?
Can you help me? How can I execute a stored procedure and map it with a model?
Eduardo Mazzucchelli
@emazzu
hi people,
how can i to do, a query for get relation to idAction and idRecource ???
I have defined it !!!
image.png
Irnel Victoria Sosa
@irnelfcb_twitter
Why does the many-to-many relationship not appear in the official LB4 documentation? @raymondfeng @bajtos https://loopback.io/doc/en/lb4/Relations.html
Petro Darii
@pdarii

Hi, maybe anybody can help me?
I'm on loopback 4, I'm have two related tables, table A belongs to table B. I'm deleting row from table B, and need that corresponding row from table A become deleted too.
I use "cascade" option, but receiving error :

Unhandled error in DELETE /api/skill-criteria/f586baf7-11fd-4a27-bd53-3bafb29b80c2: 500 error: update or delete on table "skillcriteria" violates foreign key constraint "userskillcriteria_skill_criteria_id_fk" on table "userskillcriteria"

Any ideas?
Thanks

DanielJaramillo94
@DanielJaramillo94

Hi, can please somebody patiently gide me trough the process of deploying a Loopback app into an Apache Server? For example, I try to run 'npm run build' to get the folder with the production code, but it doesn't seem to work, but I expected it, because I am not having any environment files in my app. I read the docs, and it says:

"By default, a LoopBack application created with the application generator has two kinds of configuration files in the server directory that you use to configure production settings..."

But when I create a project, I cannot find these two files anywhere.

Any help is appreciated.

DanielJaramillo94
@DanielJaramillo94
Also, can you explain me please why a 'dist' folder is containing the test folder?
DanielJaramillo94
@DanielJaramillo94
I will explain better what is my problem.
I am working with LoopBack and MySQL for the database, and is happening that in my development environment I am not having any issues, but in the server, that have installed PM2 for handling the Node processes, it is happening that when I retrieve a timestamp value, I am getting a JSON with the time BUT it have 5 hours less than time in datase. I live in a country with GMT-5, so I guess that's the reason for subtracting 5 hours. The thing is that the server is running directly my developing code, just with changes in the datasource.json file so the connection with the production database can be done properly. My boss sugest me to make a build process for the code (as we do in the Vue project —we're working the front with Vue—) and just use that code in the production environment; so that is why I'm consulting how to do that production dist folder.
manjunaths222
@manjunaths222
Hi ppl.
I have a use case where I need to call the "Third Party API" during the startup of the Loopback4 based server. Is there any way to do that? i.e. any way to call the other REST API during the booting of the loopback4?