Skip to content

Commit

Permalink
Update services apps.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Feb 4, 2024
1 parent 4e58adf commit 3df0069
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/database/Database.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ class Database
public:
Database(const String &url = "")
{
this->dbUrl = url;
this->service_url = url;
};

Database &operator=(Database &rhs)
{
this->dbUrl = rhs.dbUrl;
this->service_url = rhs.service_url;
return *this;
}

Expand Down Expand Up @@ -826,7 +826,7 @@ class Database
*/
void url(const String &url)
{
this->dbUrl = url;
this->service_url = url;
}

/**
Expand All @@ -850,7 +850,7 @@ class Database
}

private:
String dbUrl;
String service_url;
uint32_t app_addr = 0;
app_token_t *app_token = nullptr;

Expand Down Expand Up @@ -909,7 +909,7 @@ class Database
String extras = auth_param ? ".json?auth=" + String(FIREBASE_AUTH_PLACEHOLDER) : ".json";

addParams(auth_param, extras, request.method, request.options, request.file);
AsyncClient::async_data_item_t *sData = request.aClient->newSlot(firebase_client_list, dbUrl, request.path, extras, request.method, request.opt, request.uid);
AsyncClient::async_data_item_t *sData = request.aClient->newSlot(firebase_client_list, service_url, request.path, extras, request.method, request.opt, request.uid);

if (!sData)
return setClientError(request, FIREBASE_ERROR_OPERATION_CANCELLED);
Expand Down
16 changes: 12 additions & 4 deletions src/firestore/Firestore.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Firestore

private:
AsyncClient *aClient = nullptr;
String url;
String service_url;
String path;
String uid;
uint32_t app_addr = 0;
Expand Down Expand Up @@ -123,20 +123,28 @@ class Firestore
firebase_firestore_transaction_read_write_option_t readWrite;
} TransactionOptions;


~Firestore(){};

Firestore(const String &url = "")
{
this->url = url;
this->service_url = url;
};

Firestore &operator=(Firestore &rhs)
{
this->url = rhs.url;
this->service_url = rhs.service_url;
return *this;
}

/**
* Set the database URL
* @param url The Firestore URL.
*/
void url(const String &url)
{
this->service_url = url;
}

void setApp(uint32_t app_addr, app_token_t *app_token)
{
this->app_addr = app_addr;
Expand Down

0 comments on commit 3df0069

Please sign in to comment.