@@ -6,10 +6,11 @@ import io.ktor.server.request.receive
6
6
import io.ktor.server.routing.Route
7
7
import io.ktor.server.routing.post
8
8
import mu.KotlinLogging
9
+ import no.nav.hjelpemidler.Configuration
10
+ import no.nav.hjelpemidler.Configuration.Profile
9
11
import no.nav.hjelpemidler.Context
10
12
import no.nav.hjelpemidler.Ntfy
11
13
import no.nav.hjelpemidler.Slack
12
- import no.nav.hjelpemidler.Configuration
13
14
import java.time.LocalDateTime
14
15
import java.util.UUID
15
16
@@ -36,25 +37,27 @@ fun Route.ordreAPI(context: Context) {
36
37
feilmelding.saksnummer,
37
38
OrdrefeilmeldingMottatt (feilmelding = feilmelding)
38
39
)
39
- Slack .post(
40
- text = " *${Configuration .profile} * - $feilmelding " ,
41
- channel = " #papaya-alerts"
42
- )
43
- Ntfy .publish(
44
- Ntfy .Notification (
45
- title = " Mottok ordrefeilmelding" ,
46
- message = " Status: ${feilmelding.status} " ,
47
- priority = Ntfy .Priority .HIGH ,
48
- actions = setOf (
49
- Ntfy .Action (
50
- action = Ntfy .ActionType .VIEW ,
51
- label = " Se detaljer i Slack" ,
52
- clear = true ,
53
- url = " https://nav-it.slack.com/archives/C02LS2W05E1"
40
+ if (Configuration .profile == Profile .PROD ) {
41
+ Slack .post(
42
+ text = " *${Configuration .profile} * - $feilmelding " ,
43
+ channel = " #papaya-alerts"
44
+ )
45
+ Ntfy .publish(
46
+ Ntfy .Notification (
47
+ title = " Mottok ordrefeilmelding" ,
48
+ message = " Status: ${feilmelding.status} " ,
49
+ priority = Ntfy .Priority .HIGH ,
50
+ actions = setOf (
51
+ Ntfy .Action (
52
+ action = Ntfy .ActionType .VIEW ,
53
+ label = " Se detaljer i Slack" ,
54
+ clear = true ,
55
+ url = " https://nav-it.slack.com/archives/C02LS2W05E1"
56
+ )
54
57
)
55
58
)
56
59
)
57
- )
60
+ }
58
61
call.response.status(HttpStatusCode .OK )
59
62
}
60
63
}
0 commit comments