Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/database",
"version": "5.39.0",
"version": "5.40.0",
"description": "The Athenna database handler for SQL/NoSQL.",
"license": "MIT",
"author": "João Lenon <lenon@athenna.io>",
Expand Down
2 changes: 1 addition & 1 deletion src/database/builders/QueryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export class QueryBuilder<
/**
* Create data or update if already exists.
*/
public async createOrUpdate(data?: Partial<T>): Promise<T | T[]> {
public async createOrUpdate(data?: Partial<T>): Promise<T> {
return this.driver.createOrUpdate(data)
}

Expand Down
2 changes: 1 addition & 1 deletion src/models/BaseModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ export class BaseModel {
where: Partial<InstanceType<T>>,
data: Partial<InstanceType<T>>,
cleanPersist = true
): Promise<InstanceType<T> | InstanceType<T>[]> {
): Promise<InstanceType<T>> {
const query = this.query()

if (where) {
Expand Down
2 changes: 1 addition & 1 deletion src/models/builders/ModelQueryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export class ModelQueryBuilder<
if (hasValue) {
const pk = this.primaryKeyProperty

return this.where(pk, hasValue[pk as any]).update(data, cleanPersist)
return this.where(pk, hasValue[pk as any]).update(data, cleanPersist) as Promise<M>
}

return this.create(data, cleanPersist)
Expand Down
Loading