Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export için Scriptleri ekle #105

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

nazmirket
Copy link

Main branchi pull edip exportlar ile beraber çözüp tekrar pr attım

.gitignore Show resolved Hide resolved
lib/Check.js Outdated
@@ -1,29 +1,34 @@
class Check {
constructor() {}
constructor() {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter ve formatter calistirmamissin sanirim. npm run lint && npm run format calistirir misin?

@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2023

Codecov Report

Merging #105 (f489895) into main (3d236ae) will increase coverage by 0.15%.
The diff coverage is 48.27%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #105      +/-   ##
==========================================
+ Coverage   52.52%   52.68%   +0.15%     
==========================================
  Files          15       14       -1     
  Lines        1068     1063       -5     
  Branches       24       23       -1     
==========================================
- Hits          561      560       -1     
+ Misses        507      503       -4     
Impacted Files Coverage Δ
models/Yardim.js 100.00% <ø> (ø)
models/YardimEt.js 100.00% <ø> (ø)
models/YardimKaydi.js 100.00% <ø> (ø)
models/İletisim.js 100.00% <ø> (ø)
routes/controllers/yardimEt.js 29.64% <33.33%> (+0.08%) ⬆️
routes/controllers/yardim.js 31.51% <41.66%> (+0.34%) ⬆️
routes/controllers/iletisim.js 41.07% <100.00%> (+0.39%) ⬆️
routes/controllers/yardimKaydi.js 46.66% <100.00%> (+0.76%) ⬆️
server/build.js 100.00% <100.00%> (ø)
lib/Check.js 35.48% <0.00%> (-2.45%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@nazmirket
Copy link
Author

npm run lint && npm run format komutlarını çalıştırdım

"rome": "^11.0.0",
"vitest": "^0.28.4"
}
"name": "deprem-io-backend",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bu dosyanin indentation'ini neden degistirdik

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bunu ben de anlayamadım normalde Rome kullanmıyorum ama uyumlu olması için tüm gerekli ayarları yaptım yine de sorun oluyor

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

degisiklikleri eski haline alalim lutfen

@@ -0,0 +1,23 @@
const express = require("express");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

artik express kullanmiyoruz. merge ederken yanlis merge etmissin sanirim.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ilgili dosya silindi

const Yardim = require("../../models/yardimModel");
const YardimKaydi = require("../../models/yardimKaydiModel");

const Yardim = require("../../models/Yardim");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dosya adlari buyuk harf olmamali.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

düzeltildi

const YardimKaydi = require("../../models/yardimKaydiModel");

const Yardim = require("../../models/Yardim");
const YardimKaydi = require("../../models/YardimKaydi");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dosya adlari kucuk harf olmali: models/yardim-kaydi ornegin

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

düzeltildi

await connection;
console.log("Veri tabanı bağlantısı sağlandı");
} catch (e) {
console.log("Veri tabanı bağlantısında hata oluştu", e);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

veritabanina baglanamazsak uygulamanin butun islevi gidiyor. bu hatayi yutmamaliyiz.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

düzeltildi


const connection = new Promise(function (resolve, reject) {
mongoose.connect(
process.env.MONGOURL,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config dosyasi kullaniyoruz. lutfen bu veriyi oradan cekelim.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotenv modülü kullanılmıyo mu

@@ -29,6 +29,7 @@ module.exports = async function (fastifyInstance) {
description: "Yardim listesi",
},
},
// @ts-ignore
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts-ignore'larin hepsi senin IDE'nden kaynaklanan sorunlari cozmek icin kullaniliyor sanirim. Typescript yazmadigimiz icin bu ignorelarin hepsini kaldiralim lutfen.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tamamdır

index.js Outdated
useNewUrlParser: true,
useUnifiedTopology: true,
})
Database.connect()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Database'in icersindeki console.log'lari kaldiralim. Aksi taktirde uygulama calisirken 2 sefer log yazmis oluyoruz. console.log yerine her zaman fastify.log kullanalim.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tabi

await connection;
console.log("Veri tabanı bağlantısı sağlandı");
} catch (e) {
console.error("Veri tabanı bağlantısında hata oluştu", e);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bu catch'i kaldir diye yorum yapmistim. duzeltildi demissin ama duzeltilmemis.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

burda bağlantı başarısız olursa error verip process exit ediliyo ben yeterli bir müdahale diye kanaat getirdim


module.exports.connect = async function () {
try {
await connection;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bu connection nereden geliyor?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aynı sayfa içerisinde benim oluşturduğum bir promise nesnesi. mongoose kütüphanesinin connect fonksiyonunu callback tarzından promise çevirdim bu connection da o promise e işaret ediyor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants