Skip to content

Commit

Permalink
fix emails
Browse files Browse the repository at this point in the history
  • Loading branch information
blennster committed Aug 16, 2022
1 parent ab7377a commit ca23f47
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Alla märkbara ändringar ska dokumenteras i denna fil.
Baserat på [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
och följer [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.1] - 2022-08-16

### Ändrat
- Man behöver inte vara email adming för att skicka epost till esek adresser

## [1.0.0] - 2022-08-16

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ekorre-ts",
"version": "1.0.0",
"version": "1.0.1",
"description": "E-Sektionens backend",
"main": "src/index.ts",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion src/resolvers/email.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { sendEmail } from '@service/email';
const emailResolver: Resolvers = {
Mutation: {
sendEmail: async (_, { options }, ctx) => {
await hasAccess(ctx, Feature.EmailAdmin);
if (!options.to.every((s) => s.endsWith('esek.se'))) {
await hasAccess(ctx, Feature.EmailAdmin);
}

const resp = await sendEmail(
options.to,
options.subject,
Expand Down

0 comments on commit ca23f47

Please sign in to comment.