Skip to content

Commit

Permalink
mod: ignore and sql
Browse files Browse the repository at this point in the history
  • Loading branch information
bennjii committed Feb 22, 2024
1 parent a57eb22 commit 20ad66e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.env
**/target
/keys
/.vscode
/.vscode
/ingress
15 changes: 15 additions & 0 deletions .idea/dataSources.xml

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

2 changes: 1 addition & 1 deletion src/methods/customer/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl Customer {
ON
(REPLACE(JSON_EXTRACT(Transactions.customer, '$.customer_id'), '"', '')) = Customer.id
WHERE
(LOWER(Customer.name) LIKE '?1' OR Customer.contact LIKE '?1')
(LOWER(Customer.name) LIKE '%?1%' OR Customer.contact LIKE '%?1%')
AND Customer.tenant_id = '?2'
GROUP BY Customer.id
LIMIT 25
Expand Down
2 changes: 1 addition & 1 deletion src/methods/ingress/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async fn upload(session: Session, file: TempFile<'_>) -> Result<(), Error> {

async fn receive_file(mut file: TempFile<'_>, tenant_id: String) -> Result<(), Error> {
let current_date = Utc::now().to_rfc3339();
let path = "/ingress/".to_string();
let path = "./ingress/".to_string();
if let Err(error) = std::fs::create_dir_all(path.clone()) {
return Err(ErrorResponse::create_error(&format!(
"Unable to create file path, {}",
Expand Down
2 changes: 1 addition & 1 deletion src/methods/transaction/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async fn update_product_status(
let fetched_transaction =
Transaction::fetch_by_ref(&data.transaction_id, session.clone(), &db.0).await?;

match fetched_transaction.get(0) {
match fetched_transaction.first() {
Some(transaction) => {
let converted: Convert<Transaction> =
Transaction::update_product_status(transaction.id.as_str(), data, session, &db.0)
Expand Down
2 changes: 1 addition & 1 deletion src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ pub async fn session_ingress_worker(db: &DbConn) {
loop {
interval.tick().await;

if let Ok(dir) = fs::read_dir("/ingress/") {
if let Ok(dir) = fs::read_dir("./ingress/") {
let found_files = dir
.map(|directory| directory.unwrap().path().to_str().unwrap().to_string())
.collect::<Vec<String>>();
Expand Down

0 comments on commit 20ad66e

Please sign in to comment.