refactor: Move reset logic to connection model

This commit is contained in:
Faruk AYDIN
2024-09-15 01:03:17 +03:00
parent 1009c71e72
commit b0abf94191
2 changed files with 13 additions and 5 deletions

View File

@@ -249,6 +249,18 @@ class Connection extends Base {
return { url };
}
async reset() {
const formattedData = this?.formattedData?.screenName
? { screenName: this.formattedData.screenName }
: null;
const updatedConnection = await this.$query().patchAndFetch({
formattedData,
});
return updatedConnection;
}
}
export default Connection;