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

Palautteet Google Sheetsiin | Antti/feedbacks-to-google-sheets #39

Merged
merged 58 commits into from
Oct 21, 2024

Conversation

anttiasmala
Copy link
Collaborator

Ensimmäiset versiot (Class- ja "funktio"-versio) Googlen API:n käyttämisestä. Voidaan vaihtaa käyttämään Make.comia, jos tulee tarve

… be 'dangerous' so most likely will be changed
.gitignore Show resolved Hide resolved
.env.example Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
backend/GoogleAPI.ts Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
.env.example Outdated Show resolved Hide resolved
backend/GoogleAPI.ts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
.env.example Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
Comment on lines 20 to 38
export async function sendFeedbackToGoogleSheets({
feedbackText,
userDetails,
}: {
feedbackText: string;
userUUID: string;
userDetails: User;
}) {
const date = `${new Date().toLocaleDateString('fi-FI')} ${new Date().toTimeString()}`;
const feedbackGiverDetails = `${userDetails.firstName} ${userDetails.lastName}\n${userDetails.email}`;
await SHEETS.spreadsheets.values.append({
auth: AUTHENTICATION,
spreadsheetId: SPREADSHEET_ID,
range: `Palautteet!A:C`,
requestBody: {
majorDimension: 'ROWS',
values: [[props.feedbackText, props.userUUID, date]],
values: [[feedbackText, feedbackGiverDetails, date]],
},
valueInputOption: 'USER_ENTERED',
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Vaihdoin propsin "suoriin variable nimiin". Tein lisäksi oman variablen, jossa määritetään nuo tiedot palautteen antajasta

Olisiko tästä

range: `Palautteet!A:C`,

tarpeellista tehdä geneeristä vai onko "kovakoodattu" ok? 😄

Copy link
Owner

Choose a reason for hiding this comment

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

Kovakoodattu on ok tässä, ohjeistit tuon sheetin nimen readme-tiedostossa hyvin.

Copy link
Owner

@samuliasmala samuliasmala left a comment

Choose a reason for hiding this comment

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

Valmis mergettäväksi! 🔥 Hienosti toimii, hyvää työtä! 👍

@anttiasmala anttiasmala merged commit 8474471 into main Oct 21, 2024
5 checks passed
@anttiasmala anttiasmala deleted the antti/feedbacks-to-google-sheets branch October 21, 2024 09:56
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.

12. Palautteet Google Spreadsheetsiin
2 participants