Skip to content

Commit

Permalink
Revert "Implement relations create method"
Browse files Browse the repository at this point in the history
This reverts commit 6699c54.
  • Loading branch information
NoelDeMartin committed Feb 16, 2024
1 parent 6699c54 commit c4e13f4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
14 changes: 7 additions & 7 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
Expand Up @@ -39,7 +39,7 @@
"homepage": "https://soukai.js.org",
"dependencies": {
"@babel/runtime": "^7.12.18",
"@noeldemartin/utils": "0.5.1-next.49cc6c9b4a20930cbf922a949135981791acc5c3",
"@noeldemartin/utils": "^0.4.0",
"@types/webpack-env": "^1.13.6",
"core-js": "^3.9.0",
"idb": "^5.0.2"
Expand Down
6 changes: 0 additions & 6 deletions src/models/relations/MultiModelRelation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ export default abstract class MultiModelRelation<
);
}

public create(model?: Related): Promise<Related>;
public create(attributes: Attributes): Promise<Related>;
public create(modelOrAttributes: Related | Attributes = {}): Promise<Related> {
return tap(this.attach(modelOrAttributes), model => model.save());
}

public attach(model?: Related): Related;
public attach(attributes: Attributes): Related;
public attach(modelOrAttributes: Related | Attributes = {}): Related {
Expand Down
6 changes: 0 additions & 6 deletions src/models/relations/SingleModelRelation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ export default abstract class SingleModelRelation<
);
}

public create(model?: Related): Promise<Related>;
public create(attributes: Attributes): Promise<Related>;
public async create(modelOrAttributes: Related | Attributes = {}): Promise<Related> {
return tap(this.attach(modelOrAttributes), model => model.save());
}

public attach(model?: Related): Related;
public attach(attributes: Attributes): Related;
public attach(modelOrAttributes: Related | Attributes = {}): Related {
Expand Down

0 comments on commit c4e13f4

Please sign in to comment.